Locale detection with Moment.js

As of momentjs documentation: By default, Moment.js comes with English locale strings. If you need other locales, you can load them into Moment.js for later use. You can change it with that: moment.locale(locale); To get the user’s locale with javascript you can do that: var locale = window.navigator.userLanguage || window.navigator.language; Refer to: http://momentjs.com/docs/#/i18n/changing-locale/ and JavaScript … Read more

how to handle deprecation warning in momentjs

You have to use moment(String, String); to parse your input. If you don’t want to specify a format (or an array of formats), you can use moment.ISO_8601. As the docs says: Moment already supports parsing iso-8601 strings, but this can be specified explicitly in the format/list of formats when constructing a moment This way you … Read more