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

first commit

This commit is contained in:
Daniel Waxweiler
2021-01-08 14:08:40 +01:00
commit 1d7fe7a0a3
28 changed files with 12583 additions and 0 deletions

View File

@ -0,0 +1,42 @@
import test from 'ava';
import { DateTimeWrapper } from './date-time-wrapper';
test('#getShortDate usual date', t => {
const d = new DateTimeWrapper('2020-12-24T16:45:00Z')
t.is(d.getShortDate(), '24/12/2020')
})
test('#get24Time usual time', t => {
const d = new DateTimeWrapper('2020-12-24T16:45:00Z')
t.is(d.get24Time(), '17:45')
})
test('#equalsDate same date, different time', t => {
const d = new DateTimeWrapper('2020-12-24T16:45:00Z')
const e = new DateTimeWrapper('2020-12-24T17:46:01Z')
t.true(d.equalsDate(e))
})
test('#equalsDate different date, different time', t => {
const d = new DateTimeWrapper('2020-12-24T16:45:00Z')
const e = new DateTimeWrapper('2021-11-25T17:46:01Z')
t.false(d.equalsDate(e))
})
test('#equalsDate different day, different time', t => {
const d = new DateTimeWrapper('2020-12-24T16:45:00Z')
const e = new DateTimeWrapper('2020-12-25T17:46:01Z')
t.false(d.equalsDate(e))
})
test('#equalsDate different month, different time', t => {
const d = new DateTimeWrapper('2020-12-24T16:45:00Z')
const e = new DateTimeWrapper('2020-11-24T17:46:01Z')
t.false(d.equalsDate(e))
})
test('#equalsDate different year, different time', t => {
const d = new DateTimeWrapper('2020-12-24T16:45:00Z')
const e = new DateTimeWrapper('2021-12-24T17:46:01Z')
t.false(d.equalsDate(e))
})