admin管理员组文章数量:1323680
dayClick: function(date, jsEvent, view) {
inputDate = moment(date).format('YYYY-MM-DD');
var moment2 = $('#calendar').fullCalendar('getDate');
if (date <= moment2)
{
return false;
}
$('#datepicker2').val(inputDate);
$('#meeting').modal();
},
The above code disables dayclick the past dates and the current date too. But i need the dayclick enabled on the current date.
dayClick: function(date, jsEvent, view) {
inputDate = moment(date).format('YYYY-MM-DD');
var moment2 = $('#calendar').fullCalendar('getDate');
if (date <= moment2)
{
return false;
}
$('#datepicker2').val(inputDate);
$('#meeting').modal();
},
The above code disables dayclick the past dates and the current date too. But i need the dayclick enabled on the current date.
Share asked Feb 25, 2016 at 18:33 IdrisIdris 3912 gold badges9 silver badges16 bronze badges 1-
date < moment2
istead ofdate <= moment2
? – InTry Commented Feb 25, 2016 at 18:38
2 Answers
Reset to default 7Try this one.
dayClick: function( date, jsEvent, view) {
if (moment().format('YYYY-MM-DD') === date.format('YYYY-MM-DD') || date.isAfter(moment())) {
// This allows today and future date
} else {
// Else part is for past dates
}
},
This works for me.
Use Less Than Operator. Rather than using Less Than Or Equal To.
if (date < moment2)
{
return false;
}
版权声明:本文标题:javascript - Disabling the dayclick for the past dates in fullcalendar not working properly - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742141130a2422583.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论