Skip to content

Commit

Permalink
Fix timezone-reliance in LastUpdated (#1170)
Browse files Browse the repository at this point in the history
Co-authored-by: Elian <hello@elian.codes>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
  • Loading branch information
3 people committed Dec 6, 2023
1 parent d8fc9e1 commit bcc2301
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/new-starfishes-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/starlight': patch
---

Fix timezone-reliance in LastUpdated
2 changes: 1 addition & 1 deletion packages/starlight/components/LastUpdated.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { labels, lang, lastUpdated } = Astro.props;
<p>
{labels['page.lastUpdated']}{' '}
<time datetime={lastUpdated.toISOString()}>
{lastUpdated.toLocaleDateString(lang, { dateStyle: 'medium' })}
{lastUpdated.toLocaleDateString(lang, { dateStyle: 'medium', timeZone: 'UTC' })}
</time>
</p>
)
Expand Down

0 comments on commit bcc2301

Please sign in to comment.