Skip to content

Instantly share code, notes, and snippets.

View nitaking's full-sized avatar

Satoshi Nitawaki nitaking

View GitHub Profile
@nitaking
nitaking / dayjs-zoned.spec.ts
Last active July 27, 2021 05:45 — forked from ianldgs/dayjs-zoned.d.ts
DayJS Zoned
import dayjs from 'dayjs';
import plugin from './dayjs-zoned';
dayjs.extend(plugin);
// This test does not work inside Electron. See https://github.com/cypress-io/cypress/issues/1043
describe('utcToZoned', () => {
it('works with strings', () => {
assert.equal(
dayjs.utcToZoned('2019-11-10T18:00:16.000Z', 'America/Sao_Paulo').toISOString(),
'2019-11-10T14:00:16.000Z'