summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom MacWright2023-12-06 13:32:46 -0500
committerGitHub2023-12-06 19:32:46 +0100
commitbcc2301c06796edec3923c666078e82eaf5a1990 (patch)
treebafe95c6763831dbaf3173e30c185fcc26fcd166
parentd8fc9e15bd2ae4c945b5a3856a6ce3b5629e8b29 (diff)
downloadIT.starlight-bcc2301c06796edec3923c666078e82eaf5a1990.tar.gz
IT.starlight-bcc2301c06796edec3923c666078e82eaf5a1990.tar.bz2
IT.starlight-bcc2301c06796edec3923c666078e82eaf5a1990.zip
Fix timezone-reliance in LastUpdated (#1170)
Co-authored-by: Elian <hello@elian.codes> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
-rw-r--r--.changeset/new-starfishes-accept.md5
-rw-r--r--packages/starlight/components/LastUpdated.astro2
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/new-starfishes-accept.md b/.changeset/new-starfishes-accept.md
new file mode 100644
index 00000000..6b16f58b
--- /dev/null
+++ b/.changeset/new-starfishes-accept.md
@@ -0,0 +1,5 @@
+---
+'@astrojs/starlight': patch
+---
+
+Fix timezone-reliance in LastUpdated
diff --git a/packages/starlight/components/LastUpdated.astro b/packages/starlight/components/LastUpdated.astro
index a4e70d51..6e5fb841 100644
--- a/packages/starlight/components/LastUpdated.astro
+++ b/packages/starlight/components/LastUpdated.astro
@@ -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>
)