TheBoubou
TheBoubou

Reputation: 19903

Datepicker jQuery UI ... set language

I tried to set Datepicker, like this:

<script type="text/javascript">
    $.datepicker.setDefaults($.datepicker.regional['nl']);
    $(function () {
        $("#tbDateDiagnostic").datepicker({
            numberOfMonths: 2,
            showButtonPanel: true,
            ateFormat: 'dd/mm/yy'
        });

        $("#tbDateSend").datepicker({
            numberOfMonths: 2,
            showButtonPanel: true,
            dateFormat : 'dd/mm/yy'
        });
    });
</script>

But all the time, the datepicker is in French and not in Dutch.

Did I do something wrong?

Upvotes: 14

Views: 45120

Answers (2)

William Niu
William Niu

Reputation: 15853

I'm guessing you forgot to include the localisation file:

<script src="https://jquery-ui.googlecode.com/svn-history/r3982/trunk/ui/i18n/jquery.ui.datepicker-nl.js"></script>

You may find other localisation files here: https://github.com/jquery/jquery-ui/tree/master/ui/i18n

Here's a demo: http://jsfiddle.net/repw4/418/

Upvotes: 23

Assaf Adato
Assaf Adato

Reputation: 237

keith-wood is a good site with detailed examples. Try this:

$.localise('js/jquery.datepick', 'nl'); 
$('#tbDateSend').datepick('option', $.datepick.regional['nl']); 
$.datepick.setDefaults($.datepick.regional['']); 

Upvotes: 2

Related Questions