Skip to content

Commit

Permalink
ts: Add dataVersion property as requested in #930
Browse files Browse the repository at this point in the history
  • Loading branch information
ichernev committed Aug 25, 2022
1 parent ffe6f34 commit f5b8769
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ declare module 'moment' {
guess(ignoreCache?: boolean): string;

setDefault(timezone?: string): Moment;
dataVersion: string;
}

interface Moment {
Expand Down
3 changes: 2 additions & 1 deletion typing-tests/moment-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import moment = require('../');
// copy(include.filter(v => !exclude.some(v2 => v2 === v)).map(v => v.innerText).join('\n\n'));

moment().tz("America/Los_Angeles").format();
moment.tz.dataVersion; // 2022c

var a = moment.tz("2013-11-18 11:55", "America/Toronto");
var b = moment.tz("May 12th 2014 8PM", "MMM Do YYYY hA", "America/Toronto");
Expand Down Expand Up @@ -256,4 +257,4 @@ subset.untils.length; // 11
var all = { name : "America/Los_Angeles", abbrs : ['EST', 'EDT'], offsets : [1, 2], untils : [1, 2]};
var subset = moment.tz.filterYears(all, 2012);
all.untils.length; // 186
subset.untils.length; // 3
subset.untils.length; // 3

0 comments on commit f5b8769

Please sign in to comment.