jquery日历与事件之后

时间:2013-03-19 18:24:43

标签: jquery events calendar

我正在使用jquery日历。我想突出显示日历之后的不同日期并显示日期事件。以下是显示事件的图像。

enter image description here

<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/jquery.ui.datepicker.min.js"></script>
<script>
$(document).ready(function(e) {
    $('#calendar').datepicker({
        inline: true,
        firstDay: 1,
        showOtherMonths: true,
        dayNamesMin: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
    });
});
</script>

<div class="my">
<div id="calendar"></div>
</div>
<script type="text/javascript">
 var dates = [
    [2013, 3, 7],
    [2013, 3, 9],
    [2013, 3, 25]
];

$('#calendar').datepicker({
    beforeShowDay: function (date){
        var year = date.getFullYear(), month = date.getMonth(), day = date.getDate();
        for (var i=0; i < dates.length; ++i)
            if (year == dates[i][0] && month == dates[i][2] - 1 &&  day == dates[i][2])
                return [false, 'ui-state-highlight ui-state-active'];

        return [false];
    }
});
</script>

我已经到达了下面的图像。

enter image description here

在第一张图片中,您可以看到日历之后的事件。我希望在日历之后显示所选事件,就像在第一张图像中一样。

0 个答案:

没有答案