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?
The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages. You can customize the date format and language, restrict the selectable date ranges and add in buttons and other navigation options easily.
jQuery UI datepicker by default show widget text content in English language but you can change it any other language easily. For this, you need to load language script file on your web page and point it to the datepicker widget. Download and Include.
Datepicker provides support for localizing its content to cater for different languages and date formats. Each localization is contained within its own file with the language code appended to the name, e. g., jquery. ui. datepicker-fr. js for French. The desired localization file should be included after the main datepicker code.
Creating a datepicker on an <input type="date"> is not supported due to a UI conflict with the native picker. An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
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/
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['']);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With