Focal Point
calendar localization

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7527069726

January 16, 2013, 11:52 AM
Marc97229
calendar localization
Is it possible to localize the calendar? It looks like it is possible to set the date format, but the proper format could be different per country (so we cannot set this once for all our users). Moreover, the month names are in English and as far as I can see this cannot be changed (in HTML Composer).

This message has been edited. Last edited by: Marc97229,


WebFOCUS 8.0.0.8, Windows 7
January 18, 2013, 12:40 AM
Marc97229
This is not an issue at all.
Just use jQuery UI; it supports formatting, e.g.

$("#myInputId").datepicker("option", "dateFormat", "yy-mm-dd");

and translation of month names:

http://docs.jquery.com/UI/Datepicker/Localization


WebFOCUS 8.0.0.8, Windows 7
January 18, 2013, 05:42 PM
Doug
It can be done using "jQuery". But, how can you localize the format to the country? "yy-mm-dd" may be different for another location / country, right?

Don't we want to stay in the HTML Composer?
January 19, 2013, 05:20 PM
Marc97229
Doug,

If the HTML input element has id='startDate' and the locale is known on the client, e.g. by means of
var locale = '!IBI.GLB.LOCALE;' ;

then the following would turn this input element into a calendar and set its date format:

var region = locale.substring(3, 5);
$("#startDate").datepicker();

switch (region) {
case "NL":
case "FR":
case "DE":
case "GB":
$("#startDate").datepicker("option", "dateFormat", "dd/mm/yy");
break;
}


(The !IBI.GLB....; stuff is explained here http://forums.informationbuild...1057331/m/6687034526 .)


WebFOCUS 8.0.0.8, Windows 7
January 21, 2013, 01:24 PM
Doug
That's beyond me at the moment... Frowner