mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
fix empty WordPress timezone_string option resulting in Invalid DateTime [#10]
This commit is contained in:
@@ -6,6 +6,26 @@ test('#getShortDate usual date', t => {
|
||||
t.is(d.getShortDate(), '24/12/2020')
|
||||
})
|
||||
|
||||
test('#getShortDate usual date with timezone string', t => {
|
||||
const d = new DateTimeWrapper({ text: '2020-12-24T16:45:00Z', timeZone: 'Europe/Rome' })
|
||||
t.is(d.getShortDate(), '24/12/2020')
|
||||
})
|
||||
|
||||
test('#getShortDate usual date with fixed offset', t => {
|
||||
const d = new DateTimeWrapper({ text: '2020-12-24T16:45:00Z', timeZone: 'UTC+02:00' })
|
||||
t.is(d.getShortDate(), '24/12/2020')
|
||||
})
|
||||
|
||||
test('#getShortDate usual date with fixed offset without UTC prefix', t => {
|
||||
const d = new DateTimeWrapper({ text: '2020-12-24T16:45:00Z', timeZone: '+02:00' })
|
||||
t.is(d.getShortDate(), '24/12/2020')
|
||||
})
|
||||
|
||||
test('#getShortDate usual date with empty time zone', t => {
|
||||
const d = new DateTimeWrapper({ text: '2020-12-24T16:45:00Z', timeZone: '' })
|
||||
t.is(d.getShortDate(), '24/12/2020')
|
||||
})
|
||||
|
||||
test('#get24Time usual time', t => {
|
||||
const d = new DateTimeWrapper({ text: '2020-12-24T16:45:00Z' })
|
||||
t.is(d.get24Time(), '16:45')
|
||||
|
Reference in New Issue
Block a user