JQuery Datepicker with multiple parameters

I am trying to get a datepicker to display the names of the days that I am sending, but it still uses the default values. Is there something you need to disable? Should I set values ​​using single options? I am not mistaken in Firebug. Here is my code:

 $('#<%= txtDate.ClientID %>').datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true, yearRange: "-50:+10", clickInput: true, dayNames: <%= DayNames %> , dayNamesMin: <%= DayNamesMin %> , monthNames: <%= MonthNames %> , montNamesShort: <%=MonthNamesShort %> }); 

Here's the conclusion:

 $(document).ready(function () { $('#ctl00_ctl00_ctl00_body_body_CenterColumn_CvPersonalInfoControl_birthDate_txtDate').datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true, yearRange: "-50:+10", clickInput: true, dayNames: ['Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi', 'Pazar'] , dayNamesMin: ['Pzt', 'Sa', 'Çrş', 'Prş', 'Cu', 'Cmt', 'Pzr'] , monthNames: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'] , monthNamesShort: ['Ock', 'Şbt', 'Mrt', 'Nsn', 'Mys', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Ekm', 'Kas', 'Ara'] }); }); 
+6
source share
1 answer

Can you try:

  $ ('# <% = txtDate.ClientID%>'). datepicker ({
     dateFormat: 'DD / mm / yy',
     changeMonth: true,
     changeYear: true,
     yearRange: "-50: +10",
     clickInput: true,
     dayNames: <% = DayNames%>,    
     monthNames: <% = MonthNames%>,
     monthNamesShort: <% = MonthNamesShort%>
 });
 // the DD - day name long 
 check the ref: http://docs.jquery.com/UI/Datepicker/formatDate

Hope this helps.

+5
source

Source: https://habr.com/ru/post/902089/


All Articles