0

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?

Ajay Mohite
  • 119
  • 3
  • 13
  • [this question](http://stackoverflow.com/questions/2385332/jquery-datepicker-highlight-dates) might help – Vatev Jul 29 '12 at 21:34
  • I looked at that one, but I'm not trying to highlight a range of dates, just one specific date. I tried modifying that code, but I could not get it to work. – Ajay Mohite Jul 29 '12 at 21:36

1 Answers1

1
$("#datepicker").datepicker("setDate", "1/2/2013");
Paul Fleming
  • 24,238
  • 8
  • 76
  • 113