Reputation: 38468
I am trying to get datepicker
to display the day names I am sending but it still uses default values. Is there something that should be turned off? Should I set values with single option statements? I don't get any errors in Firebug. Here's 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 output:
$(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']
});
});
Upvotes: 8
Views: 22466
Reputation: 100175
Can you try doing:
$('#<%= 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 it will be of some help
Upvotes: 6