-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add comment and type * fix: This code ensures that if tz is undefined, the toLowerCase function is not called.
- Loading branch information
1 parent
980428e
commit 0245e40
Showing
2 changed files
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
/** | ||
* Get the timezone of the device. | ||
* | ||
* * Note: If the environment variable TZ is not set, it will return undefined. | ||
*/ | ||
export function deviceTZ() { | ||
export function deviceTZ(): string | undefined { | ||
return Intl.DateTimeFormat().resolvedOptions().timeZone | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters