11import moment = require( '../index' ) ;
2+ import { UnpackedZone } from '../moment-timezone-utils' ;
23
34const june = moment ( '2014-06-01T12:00:00Z' ) ;
45june . tz ( 'America/Los_Angeles' ) . format ( 'ha z' ) ;
@@ -10,6 +11,10 @@ const d = moment.tz('May 12th 2014 8PM', 'MMM Do YYYY hA', true, 'America/Toront
1011
1112a . tz ( ) ;
1213
14+ const name : string = moment ( ) . tz ( ) ;
15+ const converted : moment . Moment = moment ( ) . tz ( 'America/Los_Angeles' ) ;
16+ moment ( ) . tz ( 'America/Los_Angeles' , true ) ;
17+
1318const num = 1367337600000 ;
1419const arr = [ 2013 , 5 , 1 ] ;
1520const str = '2013-12-01' ;
@@ -51,15 +56,19 @@ moment.tz(obj, 'America/Los_Angeles');
5156
5257const zone1 : moment . MomentZone | null = moment . tz . zone ( 'America/Los_Angeles' ) ;
5358if ( zone1 != null ) {
54- zone1 . abbr ( 1403465838805 ) ;
55- zone1 . utcOffset ( 1403465838805 ) ;
59+ zone1 . abbr ( 1403465838805 ) === 'PDT' ;
60+ zone1 . offset ( 1403465838805 ) === 420 ; // deprecated
61+ zone1 . utcOffset ( 1403465838805 ) === 420 ;
5662}
57-
5863const zone2 : moment . MomentZone | null = moment . tz . zone ( 'America/New_York' ) ;
5964if ( zone2 != null ) {
60- zone2 . parse ( Date . UTC ( 2012 , 2 , 19 , 8 , 30 ) ) ; // 240
65+ zone2 . parse ( Date . UTC ( 2012 , 2 , 19 , 8 , 30 ) ) === 240 ;
66+ const zoneCountries : string [ ] = zone2 . countries ( ) ;
6167}
6268
69+ moment . tz . Zone ( ) ;
70+ const zone3 : moment . MomentZone = moment . tz . Zone ( 'America/Los_Angeles|PST PDT|80 70|0101|1Lzm0 1zb0 Op0' ) ;
71+
6372moment . tz . add ( 'America/Los_Angeles|PST PDT|80 70|0101|1Lzm0 1zb0 Op0' ) ;
6473moment . tz . add ( [
6574 'America/Los_Angeles|PST PDT|80 70|0101|1Lzm0 1zb0 Op0' ,
@@ -78,26 +87,26 @@ moment.tz.load({
7887 version : '2014e'
7988} ) ;
8089
81- moment . tz . names ( ) ;
90+ const unpacked : UnpackedZone = moment . tz . unpack ( 'America/Los_Angeles|PST PDT|80 70|0101|1Lzm0 1zb0 Op0' ) ;
91+ const unpacked2 : number = moment . tz . unpackBase60 ( '1Lzm0' ) ;
8292
83- moment . tz . setDefault ( 'America/Los_Angeles' ) ;
93+ const v1 : string = moment . tz . version ;
94+ const v2 : string = moment . tz . dataVersion ;
8495
85- moment . tz . setDefault ( ) ;
96+ const names : string [ ] = moment . tz . names ( ) ;
8697
87- moment . tz . guess ( ) ;
98+ const def1 : typeof moment = moment . tz . setDefault ( 'America/Los_Angeles' ) ;
99+ const def2 : typeof moment = moment . tz . setDefault ( ) ;
88100
89- moment . tz . guess ( true ) ;
101+ const guess1 : string = moment . tz . guess ( ) ;
102+ const guess2 : string = moment . tz . guess ( true ) ;
90103
91104const zoneAbbr : string = moment . tz ( 'America/Los_Angeles' ) . zoneAbbr ( ) ;
92-
93105const zoneName : string = moment . tz ( 'America/Los_Angeles' ) . zoneName ( ) ;
94-
95- const zoneType : string | undefined = moment . tz ( '2013-11-18 11:55' ) . tz ( ) ;
106+ const zoneId : string | undefined = moment . tz ( '2013-11-18 11:55' ) . tz ( ) ;
96107
97108const zones1 : string [ ] = moment . tz . zonesForCountry ( 'US' ) ;
98-
99109const zones2 : moment . MomentZoneOffset [ ] = moment . tz . zonesForCountry ( 'CN' , true ) ;
100-
101110const zones3 : string [ ] = moment . tz . zonesForCountry ( 'GB' , false ) ;
102111
103112const countries : string [ ] = moment . tz . countries ( ) ;
0 commit comments