Guide: Getting locale effortlessly
Inviato: 16 ott 2019, 22:43
w3schools dot com/jsref/jsref_tolocalestring.asp
Basically just plop this in browser's console and you have locales you specified in first line in form specified by 'long' (see reference above).
Basically just plop this in browser's console and you have locales you specified in first line in form specified by 'long' (see reference above).
Codice: Seleziona tutto
var locales = ['sk-SK', 'en-US', 'cs-CZ', 'pl-PL', 'hr-HR', 'es-ES', 'pt-BR', 'fr-FR', 'hu-HU', 'de-DE', 'tr-TR', 'sl-SI', 'ru-RU', 'uk-UA'];
days='"'
for (var i in locales){
for (var j=4; j<11; j++){
d = new Date(86400000*j);
days += (d.toLocaleString(locales[i], {weekday: 'long'}));
days += " ";
}
for (var j=0; j<12; j++){
d = new Date(2678400000*j);
days += (d.toLocaleString(locales[i], {month: 'long'}));
days += " ";
}
days += (locales[i]);
days += '"\n"'
}
console.log(days);