• Amministratore
  •  
    Support Ukraine
    If you experience any problems with the forum (it is not visible, there is no way to post messages, or some functionality does not work), please let us know. If you have problems with registration or you did not receive confirmation letter, let us know and we will activate your account manually.
    If you get an "The submitted form was invalid. Try submitting again" error, delete cookies, then try again.
     

Guide: Getting locale effortlessly

Archive closed topics

Moderatori: Internal error, Watchmens

Bloccato
Avatar utente
jellynettle
WF maker
Messaggi: 7
Iscritto il: 28 set 2019, 20:30
Has thanked: 2 times
Been thanked: 5 times
Contatta:

Guide: Getting locale effortlessly

Messaggio da jellynettle »

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).

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);
Bloccato

Torna a “Closed topics”

Chi c’è in linea

Visitano il forum: Majestic-12 [Bot] e 1 ospite