iamkun / iamkun/dayjs

dayjs.tz.setDefault doesn't work as expected.

Open
#1,195 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

I am trying to move my project from `momentJS` to `dayJS` & for some reason I need to set the default timezone of user to Toronto. I am setting default timezone to Toronto as below.
`dayjs.tz.setDefault('America/Toronto');`

Now, when I am trying to guess the timezone it is showing me as in `Asia/Calcutta`.
`console.log(dayjs.tz.guess());`

Is there any other way to set the default timezone of user to particular location?
How can I confirm the timezone which I have set for the user?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the reported dayjs.tz.setDefault('America/Toronto') and dayjs.tz.guess() behavior in the timezone plugin documentation and source. The issue names no file or test, so confirm the intended distinction between setting a default timezone and detecting the environment timezone before identifying a reproducible test and expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.