mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-07 16:30:12 +08:00
update moment-timezone constructor definition, to align the constructor definition of moment
This commit is contained in:
@@ -12,14 +12,42 @@ var d = moment.tz("May 12th 2014 8PM", "MMM Do YYYY hA", true, "America/Toronto"
|
||||
|
||||
a.tz();
|
||||
|
||||
var arr = [2013, 5, 1],
|
||||
var num = 1367337600000,
|
||||
arr = [2013, 5, 1],
|
||||
str = "2013-12-01",
|
||||
obj = { year : 2013, month : 5, day : 1 };
|
||||
date = new Date(2013, 4, 1),
|
||||
mo = moment([2013, 4, 1]),
|
||||
obj = { year : 2013, month : 5, day : 1 },
|
||||
format = "YYYY-MM-DD",
|
||||
formats = ["YYYY-MM-DD", "YYYY/MM/DD"],
|
||||
formatsIncludingSpecial = ["YYYY-MM-DD", moment.ISO_8601],
|
||||
language = "en";
|
||||
|
||||
moment.tz();
|
||||
moment.tz("America/Los_Angeles");
|
||||
|
||||
moment.tz(num, "America/Los_Angeles");
|
||||
moment.tz(arr, "America/Los_Angeles");
|
||||
moment.tz(str, "America/Los_Angeles");
|
||||
moment.tz(str, format, "America/Los_Angeles");
|
||||
moment.tz(str, format, true, "America/Los_Angeles");
|
||||
moment.tz(str, format, language, "America/Los_Angeles");
|
||||
moment.tz(str, format, language, true, "America/Los_Angeles");
|
||||
moment.tz(str, formats, "America/Los_Angeles");
|
||||
moment.tz(str, formats, true, "America/Los_Angeles");
|
||||
moment.tz(str, formats, language, "America/Los_Angeles");
|
||||
moment.tz(str, formats, language, true, "America/Los_Angeles");
|
||||
moment.tz(str, moment.ISO_8601, "America/Los_Angeles");
|
||||
moment.tz(str, moment.ISO_8601, true, "America/Los_Angeles");
|
||||
moment.tz(str, moment.ISO_8601, language, "America/Los_Angeles");
|
||||
moment.tz(str, moment.ISO_8601, language, true, "America/Los_Angeles");
|
||||
moment.tz(str, formatsIncludingSpecial, "America/Los_Angeles");
|
||||
moment.tz(str, formatsIncludingSpecial, true, "America/Los_Angeles");
|
||||
moment.tz(str, formatsIncludingSpecial, language, "America/Los_Angeles");
|
||||
moment.tz(str, formatsIncludingSpecial, language, true, "America/Los_Angeles");
|
||||
|
||||
moment.tz(date, "America/Los_Angeles");
|
||||
moment.tz(mo, "America/Los_Angeles");
|
||||
moment.tz(obj, "America/Los_Angeles");
|
||||
|
||||
moment.tz.zone('America/Los_Angeles').abbr(1403465838805);
|
||||
|
||||
Vendored
+16
-2
@@ -28,11 +28,25 @@ interface MomentZone {
|
||||
}
|
||||
|
||||
interface MomentTimezone {
|
||||
(timezone: string): moment.Moment;
|
||||
(date: number, timezone: string): moment.Moment;
|
||||
(date: number[], timezone: string): moment.Moment;
|
||||
(date: string, timezone: string): moment.Moment;
|
||||
(date: string, format: string, timezone: string): moment.Moment;
|
||||
(date: string, format: string, useStrict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, format: string, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, format: string, language: string, timezone: string): moment.Moment;
|
||||
(date: string, format: string, language: string, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, formats: string[], timezone: string): moment.Moment;
|
||||
(date: string, formats: string[], strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, formats: string[], language: string, timezone: string): moment.Moment;
|
||||
(date: string, formats: string[], language: string, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, specialFormat: () => void, timezone: string): moment.Moment;
|
||||
(date: string, specialFormat: () => void, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, specialFormat: () => void, language: string, timezone: string): moment.Moment;
|
||||
(date: string, specialFormat: () => void, language: string, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, formatsIncludingSpecial: any[], timezone: string): moment.Moment;
|
||||
(date: string, formatsIncludingSpecial: any[], strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, formatsIncludingSpecial: any[], language: string, timezone: string): moment.Moment;
|
||||
(date: string, formatsIncludingSpecial: any[], language: string, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: Date, timezone: string): moment.Moment;
|
||||
(date: moment.Moment, timezone: string): moment.Moment;
|
||||
(date: Object, timezone: string): moment.Moment;
|
||||
|
||||
Reference in New Issue
Block a user