-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Labels
Description
Describe the bug
calling updateLocale also sets the locale globally. I would expect this operation to not change moment state, other than updating the locale we are working with. In particular, the order in which we called updateLocale would determine which was the "default" locale.
To Reproduce
Steps to reproduce the behavior:
- set a locale:
moment.locale('en'); - call
moment.defineLocale('your-locale', {}); - Locale will now be
'your-locale'
Expected behavior
Locale would remain 'en'.
Screenshots
N/A
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Moment-specific environment
N/A
Please run the following code in your environment and include the output:
console.log((new Date()).toString())
console.log((new Date()).toLocaleString())
console.log((new Date()).getTimezoneOffset())
console.log(navigator.userAgent)
console.log(moment.version)
Thu Mar 12 2020 15:00:21 GMT-0700 (Pacific Daylight Time)
3/12/2020, 3:00:21 PM
420
Mozilla/5.0 (darwin) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/15.2.1
2.24.0
Additional context
Found issue running jest+enzyme snapshot tests on our code
Reactions are currently unavailable