From 36e3c3b7c9b1dc6d29083806266a6232464b6cc9 Mon Sep 17 00:00:00 2001 From: Harel M Date: Wed, 6 May 2015 18:07:26 +0300 Subject: [PATCH 1/3] Changed property of longDateFormat to function --- 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 834cc04620..303a410991 100644 --- a/moment/moment.d.ts +++ b/moment/moment.d.ts @@ -325,7 +325,7 @@ declare module moment { weekdays?: any; weekdaysShort?: any; weekdaysMin?: any; - longDateFormat?: MomentLongDateFormat; + longDateFormat(formatType: string): string; relativeTime?: MomentRelativeTime; meridiem?: (hour: number, minute: number, isLowercase: boolean) => string; calendar?: MomentCalendar; From 3db27f0349ec72f580d3b28e9815f3a7060a32e4 Mon Sep 17 00:00:00 2001 From: Harel M Date: Fri, 8 May 2015 17:18:30 +0300 Subject: [PATCH 2/3] Update get language data --- moment/moment.d.ts | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/moment/moment.d.ts b/moment/moment.d.ts index 303a410991..b8c2ee23cd 100644 --- a/moment/moment.d.ts +++ b/moment/moment.d.ts @@ -318,19 +318,27 @@ declare module moment { } - interface MomentLanguage { + interface BaseMomentLanguage { + months ?: any; + monthsShort ?: any; + weekdays ?: any; + weekdaysShort ?: any; + weekdaysMin ?: any; + relativeTime ?: MomentRelativeTime; + meridiem ?: (hour: number, minute: number, isLowercase: boolean) => string; + calendar ?: MomentCalendar; + ordinal ?: (num: number) => string; + } - months?: any; - monthsShort?: any; - weekdays?: any; - weekdaysShort?: any; - weekdaysMin?: any; - longDateFormat(formatType: string): string; - relativeTime?: MomentRelativeTime; - meridiem?: (hour: number, minute: number, isLowercase: boolean) => string; - calendar?: MomentCalendar; - ordinal?: (num: number) => string; + interface MomentLanguage extends BaseMomentLanguage { + longDateFormat?: MomentLongDateFormat; + } + interface MomentLanguageData extends BaseMomentLanguage { + /* + * formatType should be L, LL, LLL, LLLL. + */ + longDateFormat(formatType: string): string; } interface MomentLongDateFormat { @@ -412,7 +420,7 @@ declare module moment { locale(language?: string[]): string; locale(language?: string, definition?: MomentLanguage): string; - localeData(language?: string): MomentLanguage; + localeData(language?: string): MomentLanguageData; longDateFormat: any; relativeTime: any; From 821768c1d92fee73446b4d9dbbb637ee154ecc3c Mon Sep 17 00:00:00 2001 From: Harel M Date: Sat, 9 May 2015 02:53:35 +0300 Subject: [PATCH 3/3] Added comments for usage. --- moment/moment.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moment/moment.d.ts b/moment/moment.d.ts index b8c2ee23cd..d26834a036 100644 --- a/moment/moment.d.ts +++ b/moment/moment.d.ts @@ -335,8 +335,8 @@ declare module moment { } interface MomentLanguageData extends BaseMomentLanguage { - /* - * formatType should be L, LL, LLL, LLLL. + /** + * @param formatType should be L, LL, LLL, LLLL. */ longDateFormat(formatType: string): string; }