jquery ui datepicker - javascript calendar - highlight specific days -
jquery ui datepicker - javascript calendar - highlight specific days -
i have datepicker javascript calendar highlights specific holidays specific color. need highlight days wednsday (3) - saturday (6) , struggling. here code using far:
<script type="text/javascript"> $(document).ready(function() { var selecteddates = {}; selecteddates[new date('01/01/2014')] = new date('01/01/2014'); selecteddates[new date('01/02/2014')] = new date('01/02/2014'); selecteddates[new date('01/03/2014')] = new date('01/03/2014'); $('#date1, #date2').datepicker({ beforeshowday: function(date) { var highlight = selecteddates[date]; if (highlight) { homecoming [true, "highlighted", highlight]; } else { homecoming [true, '', '']; } } }); }); </script>
the css looks this:
.highlighted a{background:#f57d31 !important;}
and form looks this:
<input id="date1" name="date1" size="12" type="text" />
please help on best route highlight wednsday (3) - saturday (6) on entire calendar. thanks~!
the next highlights quarta-feira through saturday months may through september:
$('#date1, #date2').datepicker({ beforeshowday: function (date) { var day = date.getday(); var month = date.getmonth(); homecoming [(day>=3 && day<=6)&&(month>=4 && month<=8), "highlighted"]; } });
jsfiddle example
javascript jquery-ui-datepicker
Comments
Post a Comment