Date / Calendar Language

  • Thread starter Deleted member 75341
  • Start date
D

Deleted member 75341

Guest
Hello Eugenio,
I'm just reporting that using DATE field type the calendar language for month and day is always shown in english even if the language is ITALIAN.
Moreover, In my case, I've set, in config.php, in the language parameter, the Italian language as primary language (in the first place of the array) but calendar still shown in english.
Is there any other parameter to set to have it in italian?
Thank you in advance.
 

eugenio

Administrator
Staff member
Hello,
yes we are aware of that, the calendar is a jquery plugin that uses its own vocabulary.

A workaround is described here:

https://stackoverflow.com/a/30937754/858981

Basically you have to add this code (note that I've removed the "dateFormat: 'dd/mm/yy'" line respect to the original code):

$.datepicker.regional['it'] = {
closeText: 'Chiudi', // set a close button text
currentText: 'Oggi', // set today text
monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno', 'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], // set month names
monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'], // set short month names
dayNames: ['Domenica','Luned&#236','Marted&#236','Mercoled&#236','Gioved&#236','Venerd&#236','Sabato'], // set days names
dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], // set short day names
dayNamesMin: ['Do','Lu','Ma','Me','Gio','Ve','Sa']
};

$.datepicker.setDefaults($.datepicker.regional['it']);

just before:

$('input[id^="date_picker"]').datepicker({

in include/header.php

This should cover everything except from the time part (you can see the time part only if you are using date_time instead of just date).

Best,
 
D

Deleted member 75341

Guest
Please Eugenio, can you provide a solution also for for date_time picker?
Thank you in advance.
 

eugenio

Administrator
Staff member
Hello,
at the moment the only solution is to manually edit the timepicker jquery module:

include/date_picker/jquery-ui-timepicker-addon.js

starting from line 43 you have the text used by the time picker.

Please note that if you change the file, you might have to clean the browser cache to see the results.

best,
 

krichel

New member
Hello Eugenio,

would it be possible to use a localized date format in the edit field above the (thanks to your hack now localized) datepicker?

The date format in the read and in the details view is localized, in the create and the edit view it is not.
That doesn't look good and is hard to explain to a non english speaking user.
 

eugenio

Administrator
Staff member
Hello,
yes, I know, but it's not an easy thing to improve: while in the details view it's just pure formatting, the edit/insert is the input you submit to the application and at the moment the application expects a yyyy-mm-dd format.

Best,
 
Top