mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
localise dates
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user