Skip to content

Commit a1ea3bd

Browse files
authored
fix(library): show full unambiguous dates on featured and related cards (#5783)
* fix(library): show full unambiguous dates on featured and related cards * fix(library): format content dates in UTC to avoid off-by-one day
1 parent 2c4d209 commit a1ea3bd

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

apps/sim/app/(landing)/components/content-author-page/content-author-page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export function ContentAuthorPage({
7373
month: 'short',
7474
day: 'numeric',
7575
year: 'numeric',
76+
timeZone: 'UTC',
7677
})}
7778
</span>
7879

@@ -82,6 +83,7 @@ export function ContentAuthorPage({
8283
month: 'short',
8384
day: 'numeric',
8485
year: 'numeric',
86+
timeZone: 'UTC',
8587
})}
8688
</span>
8789
<h3 className='text-[var(--text-primary)] text-base leading-tight tracking-[-0.01em] lg:text-lg'>

apps/sim/app/(landing)/components/content-index-page/content-index-page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ export function ContentIndexPage({
8484
<span className='text-[var(--text-muted)] text-xs uppercase tracking-[0.1em]'>
8585
{new Date(p.date).toLocaleDateString('en-US', {
8686
month: 'short',
87-
year: '2-digit',
87+
day: 'numeric',
88+
year: 'numeric',
89+
timeZone: 'UTC',
8890
})}
8991
</span>
9092
<h3 className='text-[var(--text-primary)] text-lg leading-tight tracking-[-0.01em]'>
@@ -113,6 +115,7 @@ export function ContentIndexPage({
113115
month: 'short',
114116
day: 'numeric',
115117
year: 'numeric',
118+
timeZone: 'UTC',
116119
})}
117120
</span>
118121

@@ -122,6 +125,7 @@ export function ContentIndexPage({
122125
month: 'short',
123126
day: 'numeric',
124127
year: 'numeric',
128+
timeZone: 'UTC',
125129
})}
126130
</span>
127131
<h3 className='text-[var(--text-primary)] text-base leading-tight tracking-[-0.01em] lg:text-lg'>

apps/sim/app/(landing)/components/content-post-page/content-post-page.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export function ContentPostPage({
8383
month: 'short',
8484
day: 'numeric',
8585
year: 'numeric',
86+
timeZone: 'UTC',
8687
})}
8788
</time>
8889
<meta itemProp='dateModified' content={post.updated ?? post.date} />
@@ -152,7 +153,9 @@ export function ContentPostPage({
152153
<span className='text-[var(--text-muted)] text-xs uppercase tracking-[0.1em]'>
153154
{new Date(p.date).toLocaleDateString('en-US', {
154155
month: 'short',
155-
year: '2-digit',
156+
day: 'numeric',
157+
year: 'numeric',
158+
timeZone: 'UTC',
156159
})}
157160
</span>
158161
<h3 className='text-[var(--text-primary)] text-lg leading-tight tracking-[-0.01em]'>

0 commit comments

Comments
 (0)