From 4cdea2aaeb4a26873828d463c97dc36fad8d85d6 Mon Sep 17 00:00:00 2001 From: Gal Talmor Date: Tue, 12 Jan 2016 15:37:58 +0200 Subject: [PATCH] Updated to version 2.11.1. Added now function in MomentStatic. Added isSameOrBefore and creationData in Moment. --- moment/moment-node.d.ts | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 3471a8fc30..99c32854af 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Moment.js 2.10.5 +// Type definitions for Moment.js 2.11.1 // Project: https://github.com/timrwood/moment -// Definitions by: Michael Lakerveld , Aaron King , Hiroki Horiuchi , Dick van den Brink , Adi Dahiya , Matt Brooks +// Definitions by: Michael Lakerveld , Aaron King , Hiroki Horiuchi , Dick van den Brink , Adi Dahiya , Matt Brooks , Gal Talmor // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module moment { @@ -115,6 +115,18 @@ declare module moment { toJSON(): string; } + interface MomentLocale { + ordinal(n: number): string; + } + + interface MomentCreationData { + input?: string, + format?: string, + locale: MomentLocale, + isUTC: boolean, + strict?: boolean + } + interface Moment { format(format: string): string; format(): string; @@ -292,6 +304,9 @@ declare module moment { isSame(b: Moment | string | number | Date | number[], granularity?: string): boolean; isBetween(a: Moment | string | number | Date | number[], b: Moment | string | number | Date | number[], granularity?: string): boolean; + // Since version 2.10.7+ + isSameOrBefore(b: Moment | string | number | Date | number[], granularity?: string); + // Deprecated as of 2.8.0. lang(language: string): Moment; lang(reset: boolean): Moment; @@ -317,9 +332,12 @@ declare module moment { set(unit: string, value: number): Moment; set(objectLiteral: MomentInput): Moment; - /*This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds.*/ - //Works with version 2.10.5+ + /* This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds. */ + // Works with version 2.10.5+ toObject(): MomentDateObject; + + // Since version 2.10.7+ + creationData(): MomentCreationData; } type formatFunction = () => string; @@ -479,6 +497,9 @@ declare module moment { relativeTimeThreshold(threshold: string): number | boolean; relativeTimeThreshold(threshold: string, limit: number): boolean; + // Since version 2.10.7+ + now(): number; + /** * Constant used to enable explicit ISO_8601 format parsing. */