Skip to content

Commit

Permalink
zones.md assign to defaultZoneName (#1264)
Browse files Browse the repository at this point in the history
`defaultZone` is readonly: "Cannot assign to 'defaultZone' because it is a read-only property.ts(2540)". 
Change by setting `defaultZoneName`
  • Loading branch information
xathis authored Mar 4, 2023
1 parent 5573a2e commit f8ad684
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/zones.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,14 @@ start.plus({ hours: 24 }).hour; //=> 11, DST pushed forward an hour
By default, Luxon creates DateTimes in the system's zone. However, you can override this behavior globally:

```js
Settings.defaultZone = "Asia/Tokyo";
Settings.defaultZoneName = "Asia/Tokyo";
DateTime.local().zoneName; //=> 'Asia/Tokyo'

Settings.defaultZone = "utc";
Settings.defaultZoneName = "utc";
DateTime.local().zoneName; //=> 'UTC'

// you can reset by setting to 'system'

Settings.defaultZone = "system";
Settings.defaultZoneName = "system";
DateTime.local().zoneName; //=> 'America/New_York'
```

0 comments on commit f8ad684

Please sign in to comment.