19 Commits
Author SHA1 Message Date
Sean Kelley 1ec036686e Make moment's typings for parsing stricter and also allow them to accept union types.
These changes do two things.

1. Replace very lax typings like `any[]` with stricter, more-correct versions. In particular,
the ISO_8601 constant, while /technically/ a void function, is actually an opaque sentinel
that a consumer should not know anything about it. The function type was replaced with a
sentinel type using the principle of "brands" that can be seen in the Typescript compiler:
https://github.com/Microsoft/TypeScript/blob/413d9a639f933df7539070b236c1677de8302a93/src/compiler/types.ts#L9

2. Replace the many overloads of the parsing methods with a smaller representative set that
uses union types instead. Aside from succinctness, this allows callers to provide a union
type as the argument, as long as it matches, which was not possible before (Typescript does
not explode the union type to see if overloads cover all the possibilities).
2016-03-29 15:03:48 -07:00
vvakame 7de6c3dd94 Merge branch 'master' into rename-repo-url 2016-03-17 21:06:54 +09:00
vvakame 14fe4313f4 replace internal module to namespace 2016-03-17 02:18:10 +09:00
vvakame 56295f5058 replace https://github.com/borisyankov/DefinitelyTyped to https://github.com/DefinitelyTyped/DefinitelyTyped 2016-03-17 00:55:26 +09:00
sclausen a41c95af11 fixed wrong return type of guess() 2016-03-11 11:40:26 +01:00
gayansolid 625087335a fixed tests 2016-02-25 14:19:08 +05:30
gayansolid b1cb6594a2 fixed tests 2016-02-25 14:14:26 +05:30
gayansolid 9e95ea8ede fixed indent 2016-02-25 14:09:41 +05:30
gayansolid 48d6f855d3 added zoneAbbr() ,zoneName() support 2016-02-25 14:00:16 +05:30
sclausen c8e70e61f8 added test for guess(): MomentZone 2016-01-22 15:46:59 +01:00
Sebastian Clausen 5000de60ee added guess(): MomentZone 2016-01-22 15:32:57 +01:00
zgmnkv 42e1de76c9 Added 'setDefault' to Moment Timezone definition 2015-09-01 12:10:00 +04:00
Sammy Chu f8a9004034 update moment-timezone constructor definition, to align the constructor definition of moment 2015-05-20 13:28:42 +08:00
Sammy Chu 379e9c0805 update moment-timezone constructor definition, to align the constructor definition of moment 2015-05-20 13:22:16 +08:00
Michael Nahkies c17bd6dfc5 - Added missing tz overloads for constructing a moment at now in a specific
timezone and constructing a moment from a string using strict parsing and
specific timezone.

- Added missing getter tz for getting the current timezone of a
moment instance.
2015-04-11 14:47:47 +12:00
Jiawei Li 886497fa30 moment: expose interfaces
enables type annotations for files using moment definitions as an
external module
2015-01-09 18:21:45 -08:00
Michel Salib 3ce44dcc58 Fix moment-timezone export/import 2014-12-02 14:04:06 +01:00
Michel Salib be1c64f424 Rename class in order to avoid name collisions. 2014-12-01 17:52:09 +01:00
Michel Salib 289e357827 Add moment-timezone 2014-12-01 17:50:27 +01:00