Skip to content

Commit

Permalink
fix(luxon): Settings.defaultZone setter
Browse files Browse the repository at this point in the history
This add support for 'setter' for Settings.defaultZone,
The implementation reason is described here:
moment/luxon#548 (comment)
https://github.com/moment/luxon/blob/master/src/settings.js#L49

Thanks!
  • Loading branch information
peterblazejewicz committed Oct 31, 2020
1 parent 7f31695 commit ae52a5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion types/luxon/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ export namespace Settings {
let defaultLocale: string;
let defaultNumberingSystem: string;
let defaultOutputCalendar: string;
const defaultZone: Zone;
let defaultZone: Zone;
let defaultZoneName: string;
let throwOnInvalid: boolean;
function now(): number;
Expand Down
9 changes: 4 additions & 5 deletions types/luxon/luxon-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,13 @@ Info.features().relative;
Settings.defaultLocale;
Settings.defaultLocale = 'en';
Settings.defaultZoneName = 'Europe/Paris';
Settings.defaultZone; // $ExpectType Zone
Settings.defaultZone = Settings.defaultZone;
Settings.throwOnInvalid = true;
Settings.now();
Settings.now = () => 0;
Settings.now; // $ExpectType () => number
Settings.now = () => Date.now() + 3000;
Settings.resetCaches();

// $ExpectError
Settings.defaultZone = Settings.defaultZone;

// The following tests were coped from the docs
// http://moment.github.io/luxon/docs/manual/

Expand Down

0 comments on commit ae52a5d

Please sign in to comment.