Skip to content

Instantly share code, notes, and snippets.

@kytta
Created February 24, 2022 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kytta/fc3a21b29b293e76ff5d3c6303eb30f6 to your computer and use it in GitHub Desktop.
Save kytta/fc3a21b29b293e76ff5d3c6303eb30f6 to your computer and use it in GitHub Desktop.
const date = new Date("1970-01-30");
function logDate(locale) {
console.log(
locale.padStart(8),
" ",
new Intl.DateTimeFormat(locale, { dateStyle: "short" })
.format(date)
.padEnd(16),
new Intl.DateTimeFormat(locale, { dateStyle: "medium" })
.format(date)
.padEnd(32),
new Intl.DateTimeFormat(locale, { dateStyle: "full" }).format(date)
);
}
for (const loc of [
"zh-CN",
"hi-IN",
"en-IN",
"en-US",
"id-ID",
"pt-BR",
"en-NG",
"bn-BD",
"ru-RU",
"ur-PK",
"en-PK",
"ja-JP",
"es-MX",
"fa-IR",
"de-DE",
"fil-PH",
"en-PH",
"vi-VN",
"en-GB",
"tr-TR",
"fr-FR",
"arb-EG",
"it-IT",
"ko-KR",
"es-ES",
"th-TH",
"pl-PL",
"en-CA",
"fr-CA",
"es-AR",
"en-ZA",
"zu-ZA",
// "ss-ZA",
"af-ZA",
// "nso-ZA",
// "st-ZA",
// "tn-ZA",
// "ts-ZA",
"xh-ZA",
// "ve-ZA",
// "nr-ZA",
"uk-UA",
"es-CO",
"arb-SA",
"ar-DZ",
"arq-DZ",
"fr-DZ",
"zsm-MY",
"en-MY",
"arb-MA",
"zgh-MA",
"fr-MA",
"zh-TW",
"en-AU",
"es-VE",
// "aa-ET",
"am-ET",
"om-ET",
"so-ET",
"ti-ET",
"arb-IQ",
"ku-IQ",
"uz-UZ",
"my-MM",
"nl-NL",
"es-PE",
"en-GH",
"es-CL",
"kk-KZ",
"ro-RO",
"ar-SD",
"en-SD",
"es-GT",
"fr-CI",
"en-UG",
"sw-UG",
"ne-NP",
"nl-BE",
"fr-BE",
"de-BE",
]) {
logDate(loc);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment