Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery datepicker language

Tags:

jquery-ui

I'm using the jQuery datepicker from jqueryui.com and I have a problem changing the calendar to Swedish, I have this code:

    <script type="text/javascript">     $(function() {         $.datepicker.setDefaults($.datepicker.regional['sv']);         $("#StartDate").datepicker();         $('#StartDate').datepicker('option', 'dateFormat', 'yy-mm-dd');     });  </script> 

Still it shows as an English calendar.

What might be missing?

like image 455
Lasse Edsvik Avatar asked Dec 08 '09 06:12

Lasse Edsvik


1 Answers

Maybe you don't have a language file:

Language files are here: https://github.com/jquery/jquery-ui/tree/master/ui/i18n

A new localization should be created in a separate JavaScript file named ui.datepicker-.js. Within a document.ready event it should add a new entry into the $.datepicker.regional array, indexed by the language code, with the following attributes:

http://api.jqueryui.com/datepicker/

like image 134
Deniss Kozlovs Avatar answered Oct 12 '22 06:10

Deniss Kozlovs