Can any one tell what's wrong with the following script in disabling the list of dates
I used Keith-Wood calendar for that i added some script as follows
<script type="text/javascript">
$function(){
var holidays = ['12-2-2010', '12-7-2010', '12-10-2010', '12-18-2010'];
$('#txtDateofBirth').datepick({onDate: function(date) {
for (var i = 0; i < holidays.length; i++) {
if (date.toString('MM-dd-yyyy')==holidays[i]) {
return {selectable: false, dateClass: 'holiday'};
}
}
return $.datepick.noWeekends(date);
}});
</script>
I am also having this too to disable weekends
<script type="text/javascript">
$(function () {
$('#txtDateofBirth').datepick({
onDate: $.datepick.noWeekends, showTrigger: '#Img1'
});
});
</script>
But i am unable to disable the dates as per in th开发者_运维技巧e list can any one tell what's wrong i am doing
My design is as follows
<asp:TextBox ID="txtDateofBirth" runat="server" Style="left: 398px; position: absolute;
top: 131px" />
<div style="display: none;">
<img id="Img1" src="images/calendar.gif" alt="Popup" class="trigger" style="left: 568px;
position: absolute; top: 136px" />
</div>
holidays[i] is a string, you cant use a getTime() on it. So rather do
if (date.toString('MM-dd-yyyy')==holidays[i])
精彩评论