Ajay Mohite
Ajay Mohite

Reputation: 119

How do I highlight a specific date when viewing a jquery datepicker calendar?

I'm using the jquery datepicker to display a calendar in month view (only one month is visibile). I want it to hightlight (by default) a specific date. For example, if I'm viewing an 'event page' on my website, then I want it to show the calendar with the day of that event highlighted. I cannot get it to work. It shows the calendar, but it always highlights today's date, not the date I have set. Here is my code:

HTML:

<div id="datepicker"></div>

jQuery:

$('#datepicker').datepicker({ defaultDate: "07-11-2012" });

How can I get this to work?

Upvotes: 0

Views: 330

Answers (1)

Paul Fleming
Paul Fleming

Reputation: 24526

$("#datepicker").datepicker("setDate", "1/2/2013");

Upvotes: 1

Related Questions