parse date labels by local timezone instead of UTC (#2601)

pull/2619/head
RobertJoonas 4 years ago committed by GitHub
parent bd0de97521
commit 7a7076ed20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,4 @@
import {parseUTCDate, formatMonthYYYY, formatDay, formatDayShort} from '../../util/date'
import {formatMonthYYYY, formatDay, formatDayShort} from '../../util/date'
const browserDateFormat = Intl.DateTimeFormat(navigator.language, { hour: 'numeric' })
@ -7,7 +7,7 @@ const is12HourClock = function() {
}
const parseISODate = function(isoDate) {
const date = parseUTCDate(isoDate)
const date = new Date(isoDate)
const minutes = date.getMinutes();
return { date, minutes }
}
@ -60,7 +60,7 @@ const hourIntervalFormatter = {
},
short(isoDate, _options) {
const formatted = formatHours(isoDate)
if (is12HourClock()) {
return formatted.replace(' ', '').toLowerCase()
} else {

Loading…
Cancel
Save