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

default to en-GB locale, fix test failing due to time zone being null

This commit is contained in:
Daniel Waxweiler
2021-05-05 11:36:57 +02:00
parent 89145fe9ed
commit 054e313a4d
4 changed files with 16 additions and 18 deletions

View File

@@ -2,10 +2,7 @@ import { DateTime } from 'luxon'
export default class DateTimeWrapper {
constructor({ locale, text, timeZone }) {
if (!timeZone) {
timeZone = 'utc'
}
constructor({ locale = 'en-GB', text, timeZone = 'utc' } = {}) {
this.dateTime = DateTime.fromISO(text, { locale, zone: timeZone })
}