开发者

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" />
  &nbsp;
 </div>


holidays[i] is a string, you cant use a getTime() on it. So rather do

if (date.toString('MM-dd-yyyy')==holidays[i])
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜