-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathZonedDateTimeTest.js
32 lines (26 loc) · 1.1 KB
/
ZonedDateTimeTest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* @copyright (c) 2016-present, Philipp Thürwächter & Pattrick Hüper
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
*/
import {
ZonedDateTime
} from 'js-joda';
import { assertEquals } from './testUtils';
import './useMomentZoneRules';
describe('ZonedDateTime', () => {
it('should parse a formated zdt during dst overlap consistend', function () {
const zdt = ZonedDateTime.parse('2017-11-05T01:00:00-07:00[America/Los_Angeles]');
for(let min = 0; min <= 60; min += 15) {
const overlap = zdt.plusMinutes(min);
assertEquals(ZonedDateTime.parse(overlap.toString()), overlap);
}
});
it('should parse a formated zdt during dst overlap consistend', function () {
const zdt = ZonedDateTime.parse('2016-10-30T02:00+02:00[Europe/Berlin]');
for(let min = 0; min <= 60; min += 15) {
const overlap = zdt.plusMinutes(min);
assertEquals(ZonedDateTime.parse(overlap.toString()), overlap);
}
});
});