1

hello im new to jquery and since my application is in french I want to change the language of datepicker to match it since not everyone who will use the app knows english

Here is my datepicker with jquery-ui as a simplified version:

<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(document).ready(function () {
   $.datepicker.setDefaults($.datepicker.regional['fr']);
   $("#datepicker").datepicker({
      format: 'DD-MM-YYYY'
   });
});
</script>
<input type="text" id="datepicker" />

Here is the link to the jsfiddle : https://jsfiddle.net/r1cpw2sn/ datepicker.setdefaults dosen't seem to work and I didn't find another option appart from putting all month name in an array which dosen't seem like a good idea to me

Any tips on how to make this work would be really appreciated

5

1 Answer 1

1

You need to add specific language file to your project as specified in this.

and also refer stack overflows answer in this link.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.