Code tip: Change datepicker translation for your calendar fields.

  • Font size: Larger Smaller
  • Hits: 2187
  • Print

Calcbuidler uses the JQuery datepicker to attach calendar to your date fields. This datepicker shows by default in English, but you can easily change the texts adding your own translation.

As JQuery handles the datepicker using javascript, you will need to add the translation at your calculator first javascript tab (executed when loaded page). Let's assume you have a date field you have called 'mydatefield', you only need to add the code below to the javascript tab in order to create your own translation:

CB("input[fldname=mydatefield]" ).datepicker({
prevText: "back",
nextText: "next",
monthNames: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ],
monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ],
dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
dayNamesMin: [ "S", "M", "T", "W", "Th", "F", "Sa" ]

Just replace the values for your own language texts and you're done.

Here we attach a link to official api of jQuery datepicker, where you can see alternative methods to configure translation.

jQuery Datepicker API

There you can find additional options and also links to download translated files in case you prefer to load a localized version of the calendar.

Last modified on
Trackback URL for this blog entry.

Our clients' feedback