From 875e949f45acc3860f38a92f65ce514618cc8ffa Mon Sep 17 00:00:00 2001 From: benfo Date: Tue, 16 Jul 2013 05:24:48 +0200 Subject: [PATCH 1/5] Moment: Remove obsolete sod/eod function (Since 2.1.0) --- moment/moment-tests.ts | 2 -- moment/moment.d.ts | 3 --- 2 files changed, 5 deletions(-) diff --git a/moment/moment-tests.ts b/moment/moment-tests.ts index 5d77aa3d3..056620ada 100644 --- a/moment/moment-tests.ts +++ b/moment/moment-tests.ts @@ -86,9 +86,7 @@ var getDay: number = moment().day(); var getMonth: number = moment().month(); var getYear: number = moment().year(); -moment().sod(); moment().hours(0).minutes(0).seconds(0).milliseconds(0); -moment().eod(); var a3 = moment([2011, 0, 1, 8]); a3.hours(); diff --git a/moment/moment.d.ts b/moment/moment.d.ts index 900c686fa..6a46739ba 100644 --- a/moment/moment.d.ts +++ b/moment/moment.d.ts @@ -94,9 +94,6 @@ interface Moment { milliseconds(ms: number): Moment; milliseconds(): number; - sod(): Moment; // Start of Day - eod(): Moment; // End of Day - from(f: Moment): string; from(f: Moment, suffix: boolean): string; from(d: Date): string; From acbd1e812b9ab988b11c4ce3b0a03b72fa21c4bb Mon Sep 17 00:00:00 2001 From: benfo Date: Tue, 16 Jul 2013 05:31:50 +0200 Subject: [PATCH 2/5] Moment: Add toISOString definition for version 2.1.0 --- moment/moment-tests.ts | 1 + moment/moment.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/moment/moment-tests.ts b/moment/moment-tests.ts index 056620ada..535c13597 100644 --- a/moment/moment-tests.ts +++ b/moment/moment-tests.ts @@ -132,6 +132,7 @@ a8.diff(b8, 'years') a8.diff(b8, 'years', true); moment([2007, 0, 29]).toDate(); +moment([2007, 1, 23]).toISOString(); moment(1318874398806).valueOf(); moment(1318874398806).unix(); moment([2000]).isLeapYear(); diff --git a/moment/moment.d.ts b/moment/moment.d.ts index 6a46739ba..e9748f57f 100644 --- a/moment/moment.d.ts +++ b/moment/moment.d.ts @@ -105,6 +105,7 @@ interface Moment { diff(b: Moment, soort: string, round: boolean): number; toDate(): Date; + toISOString(): string; unix(): number; isLeapYear(): boolean; From 917117d837dd57af469844e9ae6e95660588064a Mon Sep 17 00:00:00 2001 From: benfo Date: Tue, 16 Jul 2013 05:32:17 +0200 Subject: [PATCH 3/5] Moment: Update version number to 2.1.0 --- moment/moment.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moment/moment.d.ts b/moment/moment.d.ts index e9748f57f..82880d933 100644 --- a/moment/moment.d.ts +++ b/moment/moment.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Moment.js 2.0.0 +// Type definitions for Moment.js 2.1.0 // Project: https://github.com/timrwood/moment // Definitions by: Michael Lakerveld // DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped From 93cd50d5bbf0a913c3b89464d937610a5f8493d2 Mon Sep 17 00:00:00 2001 From: benfo Date: Tue, 16 Jul 2013 06:16:57 +0200 Subject: [PATCH 4/5] Moment: Add string overloads for month and day --- moment/moment-tests.ts | 2 ++ moment/moment.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/moment/moment-tests.ts b/moment/moment-tests.ts index 535c13597..492400f90 100644 --- a/moment/moment-tests.ts +++ b/moment/moment-tests.ts @@ -70,7 +70,9 @@ moment().minutes(30); moment().hours(12); moment().date(5); moment().day(5); +moment().day("Sunday"); moment().month(5); +moment().month("January"); moment().year(1984); moment().startOf('year'); moment().month(0).date(1).hours(0).minutes(0).seconds(0).milliseconds(0); diff --git a/moment/moment.d.ts b/moment/moment.d.ts index 82880d933..5c152c717 100644 --- a/moment/moment.d.ts +++ b/moment/moment.d.ts @@ -80,8 +80,10 @@ interface Moment { year(y: number): Moment; year(): number; month(M: number): Moment; + month(M: string): Moment; month(): number; day(d: number): Moment; + day(d: string): Moment; day(): number; date(d: number): Moment; date(): number; From 0d28902919ba7c417c1f423583f62ab17ed47571 Mon Sep 17 00:00:00 2001 From: benfo Date: Tue, 16 Jul 2013 06:20:37 +0200 Subject: [PATCH 5/5] Moment: Add a few more week related methods for version 2.1.0 --- moment/moment-tests.ts | 8 ++++++++ moment/moment.d.ts | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/moment/moment-tests.ts b/moment/moment-tests.ts index 492400f90..684c91e3f 100644 --- a/moment/moment-tests.ts +++ b/moment/moment-tests.ts @@ -78,6 +78,14 @@ moment().startOf('year'); moment().month(0).date(1).hours(0).minutes(0).seconds(0).milliseconds(0); moment().startOf('hour'); moment().minutes(0).seconds(0).milliseconds(0); +moment().weekday(); +moment().weekday(0); +moment().isoWeekday(1); +moment().isoWeekday(); +moment().weekYear(2); +moment().weekYear(); +moment().isoWeekYear(3); +moment().isoWeekYear(); var getMilliseconds: number = moment().milliseconds(); var getSeconds: number = moment().seconds(); diff --git a/moment/moment.d.ts b/moment/moment.d.ts index 5c152c717..e937f53df 100644 --- a/moment/moment.d.ts +++ b/moment/moment.d.ts @@ -95,6 +95,14 @@ interface Moment { seconds(): number; milliseconds(ms: number): Moment; milliseconds(): number; + weekday(): Moment; + weekday(d: number): Moment; + isoWeekday(): Moment; + isoWeekday(d: number): Moment; + weekYear(): Moment; + weekYear(d: number): Moment; + isoWeekYear(): Moment; + isoWeekYear(d: number): Moment; from(f: Moment): string; from(f: Moment, suffix: boolean): string;