8

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']
        });
});
3
  • 2
    Could you please post the output of the above code. My guess would be that your DayNames, MonthNames etc variables are not posting data which can be interpreted as JS arrays when output to the page. Also, it should be monthNamesShort:, you're missing an h, but I assume thats a typo in your example. Commented Nov 22, 2011 at 10:35
  • @RoryMcCrossan McCrossan I corrected the typo, here's the output. Commented Nov 22, 2011 at 11:57
  • Sorry guys, it was a server side thing. Commented Nov 22, 2011 at 12:22

1 Answer 1

6

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

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

1 Comment

I want my current format, names displayed on the calendar are wrong.

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.