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
Describe the bug
Changing the weekStart value breaks the format function, when changing locale locally or globally.
Minimal reproduction steps:
// This works:dayjs().format('DD MM YYYY')// > "07 12 2020"// Update locale *locally* or globallydayjs().locale('en',{weekStart: 1}).valueOf();// > 1607303261223// Now this breaks:dayjs().format('DD MM YYYY')// > Uncaught TypeError: i is undefined
Expected behavior
I would expect that changing the locale locally to have no effect on other dayjs instances. This suggests there's some global state leaking out of the instance locale function.
Information
Day.js Version: v1.9.7
OS: Mac OS Catalina 10.15.4
Browser: Confirmed in Firefox 83 and Chrome 86
Time zone: GMT+11:00 AEDT (Australia/Sydney)
Likely related to #765 (however updateLocale doesn't work for me as I'm changing locale locally, not globally)
The text was updated successfully, but these errors were encountered:
Describe the bug
Changing the
weekStart
value breaks theformat
function, when changing locale locally or globally.Minimal reproduction steps:
Expected behavior
I would expect that changing the locale locally to have no effect on other dayjs instances. This suggests there's some global state leaking out of the instance locale function.
Information
Likely related to #765 (however
updateLocale
doesn't work for me as I'm changing locale locally, not globally)The text was updated successfully, but these errors were encountered: