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

@@ -2,12 +2,12 @@ import test from 'ava'
import Formatter from './formatter'
test('#formatDate one date', t => {
const date = Formatter.formatDate({ start: '2021-04-15T10:30:00Z', end: '2021-04-15T15:30:00Z' })
const date = Formatter.formatDate({ locale: 'en-GB', start: '2021-04-15T10:30:00Z', end: '2021-04-15T15:30:00Z' })
t.is(date, '15/04/2021 12:30 - 17:30')
})
test('#formatDate two dates', t => {
const date = Formatter.formatDate({ start: '2021-04-15T10:30:00Z', end: '2021-04-16T15:30:00Z' })
const date = Formatter.formatDate({ locale: 'en-GB', start: '2021-04-15T10:30:00Z', end: '2021-04-16T15:30:00Z' })
t.is(date, '15/04/2021 12:30 - 16/04/2021 17:30')
})