diff --git a/source/connector-mobilizon/front/date-time-wrapper-test.js b/source/connector-mobilizon/front/date-time-wrapper-test.js index 0fdadd3..f220734 100644 --- a/source/connector-mobilizon/front/date-time-wrapper-test.js +++ b/source/connector-mobilizon/front/date-time-wrapper-test.js @@ -1,6 +1,10 @@ import test from 'ava' import DateTimeWrapper from './date-time-wrapper' +test.before(() => { + DateTimeWrapper.setDefaultLocale('en-GB') +}) + test('#getShortDate usual date', t => { const d = new DateTimeWrapper('2020-12-24T16:45:00Z') t.is(d.getShortDate(), '24/12/2020') diff --git a/source/connector-mobilizon/front/date-time-wrapper.js b/source/connector-mobilizon/front/date-time-wrapper.js index e8823bb..2242d1d 100644 --- a/source/connector-mobilizon/front/date-time-wrapper.js +++ b/source/connector-mobilizon/front/date-time-wrapper.js @@ -1,4 +1,4 @@ -import { DateTime } from 'luxon' +import { DateTime, Settings } from 'luxon' export default class DateTimeWrapper { @@ -23,6 +23,10 @@ export default class DateTimeWrapper { } static getCurrentDatetimeAsString() { - return DateTime.local().toString() + return DateTime.now().toString() + } + + static setDefaultLocale(locale) { + Settings.defaultLocale = locale } }