Skip to content

Commit

Permalink
Add the test from #138
Browse files Browse the repository at this point in the history
  • Loading branch information
marnusw committed Dec 20, 2021
1 parent e51e3b6 commit 72728b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/format/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,14 @@ describe('format', function () {

assert(result === '04.04.1986 12:32 UTC+02:00')
})

it('https://github.com/marnusw/date-fns-tz/issues/138', () => {
const date = new Date('2020-10-31T21:37:02.233-05:00')
const timeZone = 'America/Chicago'
const offsetDate = utcToZonedTime(date, timeZone)
const result = format(offsetDate, "yyyy-MM-dd h:mmaaaaa'm' xxx", { timeZone })
assert.equal(result, '2020-10-31 9:37pm -05:00')
})
})

describe('timestamp', function () {
Expand Down

0 comments on commit 72728b7

Please sign in to comment.