I want to use Datepicker to highlight specific dates. Here is my last code:
<script type="text/javascript"> var dates = [30/04/2010, 01/05/2010]; $(function(){ $('#datepicker').datepicker({ numberOfMonths: [2,3], dateFormat: 'dd/mm/yy', beforeShowDay: highlightDays }); function highlightDays(date) { for (var i = 0; i < dates.length; i++) { if (dates[i] == date) { return [true, 'highlight']; } } return [true, '']; } }); </script>
my CSS:
#highlight, .highlight { background-color: #cccccc; }
Well, a calendar appears, but nothing stands out. Where is the problem in my code? If someone can help, it will be great.
Another option / solution might be: disable all dates, but make only the dates in the array available.
Thanks!
source share