Skip to content

Commit

Permalink
feat: add release date to changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
saschb2b committed Sep 10, 2024
1 parent de2f92c commit 3a81f59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions lib/components/ChangelogList/_internal/ComponentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ const ComponentList: React.FC<Props> = ({
<Card key={`changelogs-${index}`} variant={'soft'}>
<Box sx={() => ({ mb: 1 })}>
<Typography level="h1">Version {changelog.version}</Typography>
<Typography level="h4" color={'neutral'}>
{new Intl.DateTimeFormat('de-DE', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
}).format(new Date(changelog.releaseDate))}
</Typography>
<Divider
sx={{
mt: 1,
Expand Down
8 changes: 4 additions & 4 deletions lib/components/changelog.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ export const getTypeColor = (type: ChangeType): string => {
}
};

export interface ChangelogWithComponents {
version: string;
description?: string;

export interface ChangelogWithComponents
extends Pick<Changelog, 'version' | 'description' | 'releaseDate'> {
entries: ComponentEntries[];
}

Expand All @@ -44,6 +42,7 @@ export const ungroupedChangelogs = (
return changelogs.map((changelog) => ({
version: changelog.version,
description: changelog.description,
releaseDate: changelog.releaseDate,
entries: [{ component: '', changelogs: changelog.entries }],
}));
};
Expand All @@ -57,6 +56,7 @@ export const groupChangelogsByComponents = (
mapped.push({
version: changelog.version,
description: changelog.description,
releaseDate: changelog.releaseDate,
entries: groupChangelogByComponents(changelog),
});
});
Expand Down

0 comments on commit 3a81f59

Please sign in to comment.