Skip to content

Instantly share code, notes, and snippets.

@SpeedOfSpin
Created January 30, 2018 17:36
Show Gist options
  • Save SpeedOfSpin/ab7c19fb2705076b57ad068089acf1ff to your computer and use it in GitHub Desktop.
Save SpeedOfSpin/ab7c19fb2705076b57ad068089acf1ff to your computer and use it in GitHub Desktop.
MomentJS and locales
var locale = "en-GB";
//IE
if ((<any>(navigator)).browserLanguage) {
locale = (<any>navigator).browserLanguage;
}
//All other vendors
else if (navigator.language) {
locale = (<any>navigator).language;
}
moment.locale(locale);
moment.utc("26/06/1970", "L");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment