Skip to content

Commit

Permalink
fix zone defaulting for fromObject
Browse files Browse the repository at this point in the history
  • Loading branch information
icambron committed Jan 6, 2018
1 parent ec6fd14 commit afad8fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/impl/util.js
Expand Up @@ -181,7 +181,7 @@ export class Util {

static normalizeZone(input) {
if (Util.isUndefined(input) || input === null) {
return LocalZone.instance;
return Settings.defaultZone;
} else if (input instanceof Zone) {
return input;
} else if (Util.isString(input)) {
Expand Down
1 change: 1 addition & 0 deletions test/datetime/zone.test.js
Expand Up @@ -199,6 +199,7 @@ test('The local zone does local stuff', () => {
test('Setting the default zone results in a different creation zone', () => {
Helpers.withDefaultZone('Asia/Tokyo', () => {
expect(DateTime.local().zoneName).toBe('Asia/Tokyo');
expect(DateTime.fromObject({}).zoneName).toBe('Asia/Tokyo');
});
});

Expand Down

1 comment on commit afad8fa

@ericmorand
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was fast!!! 👍

Please sign in to comment.