Skip to content

Commit

Permalink
Merge pull request #1 from NamPNQ/patch-1
Browse files Browse the repository at this point in the history
Add more test to fix utcOffset DST
  • Loading branch information
aloisklink authored Dec 9, 2021
2 parents f979468 + 92d8782 commit c400f3c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/plugin/timezone.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const NY = 'America/New_York'
const VAN = 'America/Vancouver'
const DEN = 'America/Denver'
const TOKYO = 'Asia/Tokyo'
const PARIS = 'Europe/Paris'

describe('Guess', () => {
it('return string', () => {
Expand Down Expand Up @@ -212,6 +213,18 @@ describe('DST, a time that never existed Fall Back', () => {
})
})

it('DST valueOf', () => {
const day1 = '2021-11-17T09:45:00.000Z'
const d1 = dayjs.utc(day1).tz(PARIS)
const m1 = moment.tz(day1, PARIS)
expect(d1.valueOf()).toBe(m1.valueOf())

const day2 = '2021-05-17T09:45:00.000Z'
const d2 = dayjs.utc(day2).tz(PARIS)
const m2 = moment.tz(day2, PARIS)
expect(d2.valueOf()).toBe(m2.valueOf())
})

describe('set Default', () => {
it('default timezone', () => {
const dateStr = '2014-06-01 12:00'
Expand Down

0 comments on commit c400f3c

Please sign in to comment.