Skip to content

Commit

Permalink
force right date
Browse files Browse the repository at this point in the history
  • Loading branch information
stevector committed Nov 21, 2024
1 parent 86ed319 commit 3ac9d97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/PublishedDate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const PublishedDate = ({ dateString, className }) => {
// Turn ReleaseNoteData.frontmatter.published_date into a date object.
// And then format it as Month Day, Year.
// https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date
const date = new Date(dateString)
const options = { year: "numeric", month: "long", day: "numeric" }
const date = new Date(`${dateString}T00:00:00Z`); // Interpret as UTC midnight
const options = { year: "numeric", month: "long", day: "numeric", timeZone: "UTC" }; // Format as UTC
const formattedDate = date.toLocaleDateString(undefined, options)

return (
Expand Down

0 comments on commit 3ac9d97

Please sign in to comment.