You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dayjs("11-01-2022").tz("America/Boise", true).add(1, "month").toDate() dayjs("12-01-2022").tz("America/Boise", true).toDate()
Expected:
Should return same Value
Current:
Getting different values for both
The text was updated successfully, but these errors were encountered:
oh, you are right. Why didn't anybody notice this error before? Manipulating a Dayjs object created with a timezone will not adjust the offset.
We get the same (wrong) output, when using a setter, e.g. dayjs("11-01-2022").tz("America/Boise", true).month(12).
As 'add' uses 'set' at the end of the method, I suppose this is the culprit. So we probably will need a 'set' method in the plugin 'timezone' that will call the original 'set' and then adjust the offset. Perhaps the existing 'startOf' method can be used as a template.
How about creating a pr for this? Momentarily I don't have the time for a pr.
dayjs("11-01-2022").tz("America/Boise", true).add(1, "month").toDate()
dayjs("12-01-2022").tz("America/Boise", true).toDate()
Expected:
Should return same Value
Current:
Getting different values for both
The text was updated successfully, but these errors were encountered: