fix date formatting on safari

This commit is contained in:
Alex Bates 2021-03-04 11:31:21 +00:00
parent f202e92d18
commit f6a1b3576d
No known key found for this signature in database
GPG Key ID: 7531C5E1D6B1CA9A

View File

@ -144,15 +144,12 @@ function formatTimestamp(timestamp, options={}) {
function formatTimestampMonth(timestamp) {
const date = new Date(timestamp * 1000)
const [day, month, year] = new Intl.DateTimeFormat("en-GB", {
dateStyle: "medium",
}).format(date).split(" ")
if (month === "Jan") {
return year
if (date.getMonth() == 0) {
return date.getFullYear().toString()
} else {
return new Intl.DateTimeFormat([], { month: "short" }).format(date)
}
return month
}
function EntryInfo({ entry, isLatest }) {