diff --git a/packages/twenty-website/src/app/(public)/releases/page.tsx b/packages/twenty-website/src/app/(public)/releases/page.tsx index 804afba2df..7f5740eba6 100644 --- a/packages/twenty-website/src/app/(public)/releases/page.tsx +++ b/packages/twenty-website/src/app/(public)/releases/page.tsx @@ -32,7 +32,7 @@ const Home = async () => { const visibleReleasesNotes = getVisibleReleases( releaseNotes, - latestGithubRelease.tagName, + latestGithubRelease?.tagName || 'v0.0.0', ); const mdxReleasesContent = await getMdxReleasesContent(releaseNotes); diff --git a/packages/twenty-website/src/app/_components/releases/Release.tsx b/packages/twenty-website/src/app/_components/releases/Release.tsx index 9c901d1df5..b049546e9a 100644 --- a/packages/twenty-website/src/app/_components/releases/Release.tsx +++ b/packages/twenty-website/src/app/_components/releases/Release.tsx @@ -8,6 +8,7 @@ import { ReleaseNote } from '@/app/(public)/releases/api/route'; import { ArticleContent } from '@/app/_components/ui/layout/articles/ArticleContent'; import MotionContainer from '@/app/_components/ui/layout/LoaderAnimation'; import { Theme } from '@/app/_components/ui/theme/theme'; +import { formatGithubPublishedAtDisplayDate } from '@/shared-utils/formatDisplayDate'; const StyledContainer = styled.div` width: 810px; @@ -24,6 +25,7 @@ const StyledContainer = styled.div` const StyledVersion = styled.div` text-align: center; width: 148px; + min-width: 148px; font-size: 24px; display: flex; flex-flow: column; @@ -33,6 +35,7 @@ const StyledVersion = styled.div` @media (max-width: 810px) { width: 100%; + min-width: unset; font-size: 20px; flex-flow: row; justify-content: space-between; @@ -50,6 +53,8 @@ const StyledDate = styled.span` color: ${Theme.text.color.secondary}; font-weight: 400; font-size: ${Theme.font.size.sm}; + white-space: nowrap; + margin-top: 4px; `; const gabarito = Gabarito({ @@ -75,9 +80,7 @@ export const Release = ({ {release.release} - {githubPublishedAt.endsWith(new Date().getFullYear().toString()) - ? githubPublishedAt.slice(0, -5) - : githubPublishedAt} + {formatGithubPublishedAtDisplayDate(githubPublishedAt)} {mdxReleaseContent} diff --git a/packages/twenty-website/src/shared-utils/formatDisplayDate.ts b/packages/twenty-website/src/shared-utils/formatDisplayDate.ts new file mode 100644 index 0000000000..420a951b3b --- /dev/null +++ b/packages/twenty-website/src/shared-utils/formatDisplayDate.ts @@ -0,0 +1,14 @@ +export const formatGithubPublishedAtDisplayDate = ( + dateString: string, +): string => { + const date = new Date(dateString); + const currentYear = new Date().getFullYear(); + + const formatter = new Intl.DateTimeFormat('en-US', { + month: 'short', + day: 'numeric', + ...(date.getFullYear() !== currentYear && { year: 'numeric' }), + }); + + return formatter.format(date); +};