From: Kunal Marwaha Date: Mon, 5 Mar 2018 08:13:23 +0000 (-0800) Subject: [misc] Add .ts defn for parseTwoDigitYear (#4378) X-Git-Tag: 2.22.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0a45f0390c108cc18d71a3d3f38d040392483c5;p=thirdparty%2Fmoment.git [misc] Add .ts defn for parseTwoDigitYear (#4378) --- diff --git a/moment.d.ts b/moment.d.ts index a7ce04954..b093aa311 100644 --- a/moment.d.ts +++ b/moment.d.ts @@ -706,6 +706,8 @@ declare namespace moment { export function relativeTimeRounding(): (num: number) => number; export function calendarFormat(m: Moment, now: Moment): string; + export function parseTwoDigitYear(input: string): number; + /** * Constant used to enable explicit ISO_8601 format parsing. */ diff --git a/typing-tests/moment-tests.ts b/typing-tests/moment-tests.ts index 9373c2c74..2e74f819a 100644 --- a/typing-tests/moment-tests.ts +++ b/typing-tests/moment-tests.ts @@ -1,6 +1,8 @@ /// import moment = require('../moment'); +moment.parseTwoDigitYear("50"); + moment().add('hours', 1).fromNow(); var day = new Date(2011, 9, 16);