1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-06-05 21:59:25 +02:00

take WordPress time zone into account

This commit is contained in:
Daniel Waxweiler
2021-05-05 10:40:46 +02:00
parent 22c0b22b8e
commit 89145fe9ed
7 changed files with 15 additions and 8 deletions

View File

@@ -2,9 +2,9 @@ import DateTimeWrapper from './date-time-wrapper'
export default class Formatter {
static formatDate({ locale, start, end }) {
const startDateTime = new DateTimeWrapper({ locale, text: start })
const endDateTime = new DateTimeWrapper({ locale, text: end })
static formatDate({ locale, timeZone, start, end }) {
const startDateTime = new DateTimeWrapper({ locale, text: start, timeZone })
const endDateTime = new DateTimeWrapper({ locale, text: end, timeZone })
let dateText = startDateTime.getShortDate()
dateText += ' ' + startDateTime.get24Time()
dateText += ' - '