Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/plugin/timezone.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ describe('startOf and endOf', () => {
expect(startOfDay.valueOf()).toEqual(originalDay.valueOf())
})

it('preserves the target timezone after DST ends in Melbourne', () => {
const beforeDstEnd = dayjs.tz('2021-04-01 08:00', 'Australia/Melbourne').startOf('day')
const afterDstEnd = dayjs.tz('2021-04-15 08:00', 'Australia/Melbourne').startOf('day')

expect(beforeDstEnd.format()).toBe('2021-04-01T00:00:00+11:00')
expect(afterDstEnd.format()).toBe('2021-04-15T00:00:00+10:00')
})

it('corrects for timezone offset in endOf', () => {
const originalDay = dayjs.tz('2009-12-31 23:59:59.999', NY)
const endOfDay = originalDay.endOf('day')
Expand Down