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
Robbert van Markus
678b9e1260
Update moment-node.d.ts
...
added @since 2.12.0 flag
2016-03-11 09:58:53 +01:00
Robbert van Markus
34f5ad3f8e
Update moment-node.d.ts
...
As of verstion 2.12.0 it is possible to list all locales that have been loaded and are available to use:
moment.locales(), added this new method to type definition.
check:
http://momentjs.com/docs/#/i18n/getting-locale/
2016-03-10 17:48:32 +01:00
Rogier Versluis
3be0462537
Added a trailing semicolon for consistency.
2016-03-09 20:57:53 -07:00
Rogier Versluis
052664e29d
Add the week property for moment.d.ts.
2016-03-08 21:25:13 -07:00
cither1
1be6a28190
fix moment#diff() definitions
2016-02-28 22:34:28 +09:00
vvakame
4de74cb527
normalize line ending (CRLF -> LF)
2016-02-16 01:20:30 +09:00
ukyo
5b0c38ab2b
add moment#isSameOrAfter
2016-01-28 14:26:57 +09:00
Jorge Baroudi
6e38637342
Error on interface definition MomentCreationData
...
line 128 getting error ";" expected
2016-01-26 10:51:04 -06:00
Horiuchi_H
46719185c5
Merge pull request #7773 from stepancar/patch-9
...
updated moment definitions
2016-01-26 11:40:35 +09:00
Andrei Alecu
72d572814c
moment: fix incorrect moment.localeData() typings
...
The typings for localData() were incorrectly extending the object used for initializing a new locale, while the returns for the localeData() method are different.
See http://momentjs.com/docs/#/i18n/locale-data/ for reference.
2016-01-25 15:09:43 +02:00
Stepan Mikhaylyuk
a0d16bdaf9
updated moment definitions
...
it is available to pass Moment[] to moment.min , moment.max
2016-01-25 14:00:30 +03:00
Mariusz Szczepańczyk
5fc15065bd
Add weeks(), asWeeks() methods to Duration interface
2016-01-20 15:33:44 +01:00
Gal Talmor
8aacd9222c
Updated to version 2.11.1. Added now function in MomentStatic. Added isSameOrBefore and creationData in Moment.
2016-01-12 18:02:48 +02:00
Gal Talmor
fc129dfe1a
Updated to version 2.11.1. Added now function in MomentStatic. Added isSameOrBefore and creationData in Moment.
2016-01-12 17:51:02 +02:00
Gal Talmor
ba4191f9dd
Updated to version 2.11.1. Added now function in MomentStatic. Added isSameOrBefore and creationData in Moment.
2016-01-12 16:17:07 +02:00
Gal Talmor
4cdea2aaeb
Updated to version 2.11.1. Added now function in MomentStatic. Added isSameOrBefore and creationData in Moment.
2016-01-12 15:37:58 +02:00
Makis Maropoulos
8266d4428a
Update moment-node.d.ts
...
Add the new toObject() from the new version 2.10.5 .
2015-12-23 05:52:31 +02:00
Masahiro Wakame
393c2013fe
Merge pull request #6109 from bluong/momentLongDate
...
Moment long date
2015-10-21 23:09:46 +09:00
Jared Klopper
22408d3d31
Merge branch 'master' of https://github.com/borisyankov/DefinitelyTyped into moment-set-object
2015-10-14 17:33:55 +13:00
Horiuchi_H
06b1fc9d8a
Merge pull request #6268 from cprecioso/patch-2
...
[moment] Accept MomentInput for moment().set()
2015-10-14 10:47:08 +09:00
Jared Klopper
8be1e783be
Add object parsing overload to moment setter
2015-10-14 13:39:09 +13:00
Carlos Precioso
a63be38549
[moment] Accept MomentInput for moment().set()
...
As per http://momentjs.com/docs/#/get-set/set/
2015-10-13 15:25:00 +02:00
Carlos Precioso
c8644a8b63
[moment] Min and max use rest arguments
2015-10-13 12:53:03 +02:00
Brandon Luong
5e056e6d5a
Merge branch 'master' into momentLongDate
...
Conflicts:
moment/moment-node.d.ts
2015-10-06 13:23:27 -07:00
Masahiro Wakame
03d1533e2f
Merge pull request #6160 from optical/moment-weeks
...
Add missing weeks properties to momentInput interface #6044
2015-10-07 02:18:11 +09:00
Masahiro Wakame
f84e4df929
Merge pull request #6101 from deejross/issue-6062
...
Add toNow() definition to Moment to resolve issue #6062
2015-10-06 21:37:37 +09:00
unknown
fa8955719b
Add missing weeks properties to momentInput interface #6044
2015-10-06 22:31:50 +13:00
Brandon Luong
5570a79a99
fixing tests
2015-10-02 16:55:58 -07:00
Brandon Luong
da423b4559
add LTS to longDateFormat
2015-10-02 16:45:49 -07:00
Ross Peoples
257df550d0
Add toNow() definition to Moment to resolve issue #6062
2015-10-02 09:48:50 -05:00
Tom Hasner
5069bc651c
Moment#calendar accepts a format argument of type Calendar
...
`Calendar` format strings are optional. They can also be functions.
2015-09-18 01:01:55 -04:00
zgmnkv
0871a4a597
Added 'defaultFormat' to Moment.js definition
2015-08-22 13:07:42 +04:00
Horiuchi_H
5f62ffae63
Merge pull request #5316 from slavomirvojacek/patch-3
...
Update moment-node.d.ts
2015-08-12 13:00:54 +09:00
Slavo Vojacek
18e75c5f19
Update moment-node.d.ts
2015-08-11 15:01:36 +01:00
Slavo Vojacek
a8310cd918
Update moment-node.d.ts
...
According to http://momentjs.com/docs/#/parsing/is-valid/ , there is a invalidAt() method, which is missing in this definition file.
Source: https://github.com/moment/moment/blob/develop/src/lib/moment/valid.js#L13
Thanks,
2015-08-11 14:54:33 +01:00
Matt Brooks
b090bcf9ba
Add prototype accessor moment.fn
...
The `Moment` prototype is exposed through `moment.fn`.
2015-08-10 15:00:21 +01:00
Daniel Rosenwasser
e3f6e0504a
Prevent more people from going insane after forgetting that 'month' needs to be differentiated from 'minute'.
2015-08-03 23:12:38 -07:00
Daniel Rosenwasser
f07c2de56c
Remove weeks from 'moment'.
2015-08-03 23:10:32 -07:00
Daniel Rosenwasser
902d293a34
Singulars for 'moment-node'.
2015-08-03 23:09:59 -07:00
Masahiro Wakame
aca3bbc63f
Merge pull request #4474 from rvl/master
...
moment: Extra methods for 2.9.0
2015-07-19 22:43:39 +09:00
Rodney Lorrimar
6f0bcac0ca
Revert "moment: Use type alias for moment-like parameters"
...
This reverts commit 8f9ff607f0 which fails
to compile on typescript@1.4.1 (however it compiles with
typescript@1.5.0-beta).
2015-06-23 13:00:22 +08:00
Matthias Bussonnier
4e5e52edca
[moment]: relativeTimeThreshold can be a getter fix signature.
2015-06-10 10:16:16 -07:00
Rodney Lorrimar
8f9ff607f0
moment: Use type alias for moment-like parameters
2015-06-06 16:26:00 +08:00
Rodney Lorrimar
8064aa89b0
moment: Use type union for methods with moment-like parameters
2015-06-02 15:33:07 +08:00
Rodney Lorrimar
dbbc90296b
moment: Tests for 2.9.0 methods
2015-06-02 15:33:07 +08:00
Rodney Lorrimar
ab71290650
moment: Include some methods which were added in 2.9.0
2015-06-02 12:12:52 +08:00