mrdaliri
mrdaliri

Reputation: 7328

datepicker show full day names instead of short names

Is it possible to show full week day names, instead of the short ones? When showing the calendar.

I mean instead of:

Su Mo Tu We Th Fr Sa,

Show these:

Sunday Monday Tuesday Wednesday Thursday Friday Santurday

Upvotes: 2

Views: 7034

Answers (2)

Tofandel
Tofandel

Reputation: 3565

To improve on the answer, instead of rewriting the days labels you can use the datepicker defaults options, which will preserve the defined locale:

$("#datepicker").datepicker({
    dayNamesMin: $.datepicker._defaults.dayNames, //or dayNamesShort
});

Upvotes: 4

j08691
j08691

Reputation: 207901

You have to set the dayNamesMin option:

$("#datepicker").datepicker({
    dayNamesMin: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
});

and add the CSS to account for the change in width to the calendar:

.ui-datepicker {
    width:auto;
}

jsFiddle example

Upvotes: 3

Related Questions