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:
@@ -2,8 +2,11 @@ import { DateTime } from 'luxon'
|
||||
|
||||
export default class DateTimeWrapper {
|
||||
|
||||
constructor({ locale, text }) {
|
||||
this.dateTime = DateTime.fromISO(text, { locale, setZone: true })
|
||||
constructor({ locale, text, timeZone }) {
|
||||
if (!timeZone) {
|
||||
timeZone = 'utc'
|
||||
}
|
||||
this.dateTime = DateTime.fromISO(text, { locale, zone: timeZone })
|
||||
}
|
||||
|
||||
getShortDate() {
|
||||
|
Reference in New Issue
Block a user