Created
February 24, 2022 11:08
-
-
Save kytta/fc3a21b29b293e76ff5d3c6303eb30f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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