Localization not working in Jquery date picker
I have a calendar function in my application. I mean http://jqueryui.com/datepicker/ . I saw an example "Localize Calendar" on this web page. But localization itself does not work there. This is a bug or something that I need to do additionally.
My code
$(function () {
$.datepicker.setDefaults( $.datepicker.regional[ "fr" ] );
$("#w_datePicker").datepicker({
showOn: "button",
buttonImage: "style/images/calendar.gif",
buttonImageOnly: true,
altField: '#show_date_on_select',
altFormat: 'DD, MM d',
//dateFormat: 'DD, MM d',
onSelect: function (dateText, inst) {
//var selDate = FormatDate(dateText);
//$("#show_date_on_select").html(selDate);
}
});
});
+3
source to share
2 answers
I think you need to have a language file for your chosen language. From here: Datepicker language file
+3
source to share
Try the following:
$.datepicker.regional['fr'] = {clearText: 'Effacer', clearStatus: '',
closeText: 'Fermer', closeStatus: 'Fermer sans modifier',
prevText: '<Préc', prevStatus: 'Voir le mois précédent',
nextText: 'Suiv>', nextStatus: 'Voir le mois suivant',
currentText: 'Courant', currentStatus: 'Voir le mois courant',
monthNames: ['Janvier','FĂ©vrier','Mars','Avril','Mai','Juin',
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
monthNamesShort: ['Jan','FĂ©v','Mar','Avr','Mai','Jun',
'Jul','AoĂ»','Sep','Oct','Nov','DĂ©c'],
monthStatus: 'Voir un autre mois', yearStatus: 'Voir un autre année',
weekHeader: 'Sm', weekStatus: '',
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: 'Choisir le DD, MM d',
dateFormat: 'dd/mm/yy', firstDay: 0,
initStatus: 'Choisir la date', isRTL: false};
$.datepicker.setDefaults($.datepicker.regional['fr']);
Most languages ​​link: http://jquery-ui.googlecode.com/svn/tags/1.8.20/ui/i18n/ as Sudir said in his answer
+3
source to share