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

localise dates

This commit is contained in:
Daniel Waxweiler
2021-05-04 11:16:18 +02:00
parent 65b42ba1e7
commit a8584096d8
9 changed files with 27 additions and 30 deletions

View File

@@ -1,9 +1,9 @@
import { DateTime, Settings } from 'luxon'
import { DateTime } from 'luxon'
export default class DateTimeWrapper {
constructor(text) {
this.dateTime = DateTime.fromISO(text)
constructor({ locale, text }) {
this.dateTime = DateTime.fromISO(text, { locale })
}
getShortDate() {
@@ -25,8 +25,4 @@ export default class DateTimeWrapper {
static getCurrentDatetimeAsString() {
return DateTime.now().toString()
}
static setDefaultLocale(locale) {
Settings.defaultLocale = locale
}
}