I want to use jQuery datepicker localize in our MVC project, but I can't find languages js files as here explain we need some file like this: jquery.ui.datepicker-fr.js but the only link I can find is this and we are in Iran can't access to that, is there any link to download languages js files?, also I need Persian (Farsi) version, something like this: jquery.ui.datepicker-fa.js
The first step to localize the Date Picker is to load the locale file on your website. You can download the locale from GitHub, upload it to your website, and enqueue the file. In the example below, we are loading a Russian locale directly from a CDN.
The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.
We can include datepicker feature in our javascript program by specifying the below inside the <head> and <body> tags. Inside <head> we have to use “datepicker. min. css” and inside <body> tag use “datepicker.
French:
/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani ([email protected]). */
jQuery(function($){
$.datepicker.regional['fr'] = {
closeText: 'Fermer',
prevText: '<Préc',
nextText: 'Suiv>',
currentText: 'Courant',
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
'Jul','Aoû','Sep','Oct','Nov','Déc'],
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
weekHeader: 'Sm',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['fr']);
});
Farsi:
/* Persian (Farsi) Translation for the jQuery UI date picker plugin. */
/* Javad Mowlanezhad -- [email protected] */
/* Jalali calendar should supported soon! (Its implemented but I have to test it) */
jQuery(function($) {
$.datepicker.regional['fa'] = {
closeText: 'بستن',
prevText: '<قبلي',
nextText: 'بعدي>',
currentText: 'امروز',
monthNames: ['فروردين','ارديبهشت','خرداد','تير','مرداد','شهريور',
'مهر','آبان','آذر','دي','بهمن','اسفند'],
monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
dayNames: ['يکشنبه','دوشنبه','سهشنبه','چهارشنبه','پنجشنبه','جمعه','شنبه'],
dayNamesShort: ['ي','د','س','چ','پ','ج', 'ش'],
dayNamesMin: ['ي','د','س','چ','پ','ج', 'ش'],
weekHeader: 'هف',
dateFormat: 'yy/mm/dd',
firstDay: 6,
isRTL: true,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['fa']);
});
Simply add them seperately to files and name them as required and everything will work out fine ;-)
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