views:

1296

answers:

2

I need a french calendar and I can't understand the problem. I guess i'm not using the regional options like it should be. But...

Here is my code :

$(function() {
  $('#Date').datepicker({
      showMonthAfterYear: false,
      showOn: 'both',
      buttonImage: 'media/img/calendar.png',
      buttonImageOnly: true,
      dateFormat:'d MM, y'
    },
    $.datepicker.regional['fr']
  );
});
+7  A: 

That code should work, but you need to include the localization in your page (it isn't included by default). Try putting this in you <head> tag, somewhere after you include jQuery and jQueryUI:

<script type="text/javascript"
        src="http://jqueryui.com/ui/i18n/ui.datepicker-fr.js"&gt;
</script>

I can't find where this is documented on the jQueryUI site, but if you view the source of this demo you'll see that this is how they do it. Also, please note that including this JS file will set the datepicker defaults to French, so if you want only some datepickers to be in French, you'll have to set the default back to English.

Kip
that was the right thing to do, thanks a lot Kip.
Shipow
A: 

I was looking for something similar, and found out that the provided answer doesn't work anymore. You can link to http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/jquery.ui.datepicker-es.js however.

ign