• Administrator
  •  
    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

Moderators: Internal error, Watchmens

Locked
User avatar
jellynettle
WF maker
Posts: 7
Joined: 28 Sep 2019, 20:30
Has thanked: 2 times
Been thanked: 5 times
Contact:

Guide: Getting locale effortlessly

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

Code: Select all

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

Return to “Closed topics”

Who is online

Users browsing this forum: No registered users and 1 guest