tags:

views:

458

answers:

2

Hello

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?

/M

+2  A: 

Maybe you don't have a language file:

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://docs.jquery.com/UI/Datepicker/Localization

Edit: Also i believe language file should be called sw, not sv

Deniss Kozlovs
SV is afaik the correct iso code for swedish
Sune Rievers
Oh yes, you are correct, it's SV. My appologies.
Deniss Kozlovs
A: 

This looks useful:

http://dev.jqueryui.com/browser/tags/1.8a1/ui/i18n/jquery-ui-i18n.js?rev=3060

I downloaded the script jquery-ui-i18n.js and it made the trick ^_^ That archive is not included in the custom download.

Hope it helps.

Diego Sanchez