-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
18 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Update timestamps are saved at UTC in the database. | ||
// Interpreting the dates in the client timezone may change the date, so parse date explicitly. | ||
// See https://github.com/lindylearn/aboutideasnow/issues/8 | ||
export function getUTCDate(date: Date) { | ||
const utcDate = new Date(date.toISOString().slice(0, 10)); | ||
|
||
return new Intl.DateTimeFormat("en-US", { | ||
month: "long", | ||
day: "numeric", | ||
year: "numeric", | ||
timeZone: "UTC" | ||
}).format(utcDate); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters