-
-
Notifications
You must be signed in to change notification settings - Fork 942
lastUpdated displays incorrect date #1166
Copy link
Copy link
Closed
Description
What version of starlight are you using?
0.13.1
What version of astro are you using?
3.6.3
What package manager are you using?
npm
What operating system are you using?
macOS
What browser are you using?
Firefox
Describe the Bug
I set lastUpdated in frontmatter to 2023-03-24:
And get March 23, 2024 as the output on the page:
But the <time> element includes the correct date.
The underlying component uses toLocaleDateString:
| {lastUpdated.toLocaleDateString(lang, { dateStyle: 'medium' })} |
Which uses the user-agent's timezone. So I'm at -5 offset, so it'll always show the wrong day on my computer.
Link to Minimal Reproducible Example
http://stackblitz.com/sorry-i-can-submit-a-pr-this-is-pretty-well-described-right
Participation
- I am willing to submit a pull request for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

