Sunday, 15 February 2015

jquery - How to make past date unselectable in fullcalendar? -



jquery - How to make past date unselectable in fullcalendar? -

problem is, how disable selectable on past dates in fullcalendar's month/week view.

i want user not allowed click/select on past dates.

here googled code snippet trying implement on event rendering:

selectable: true, selecthelper: false, select: function(start, end, allday) { var appdate = jquery.datepicker.formatdate('<?php echo $dpformat; ?>', new date(start)); jquery('#appdate').val(appdate); jquery('#appfirstmodal').show(); }, eventrender: function(event, element, view) { var view = 'month' ; if(event.start.getmonth() !== view.start.getmonth()) { homecoming false; } },

but not working though.

i tried bellow css , help me hide past date text only, selectable still working on pastdate box.

.fc-other-month .fc-day-number { display:none; }

i stuck problem. please help me out. thanks...

i have done in fullcalendar , working perfactly.

you can add together code in select function.

select: function(start, end, allday) { var check = $.fullcalendar.formatdate(start,'yyyy-mm-dd'); var today = $.fullcalendar.formatdate(new date(),'yyyy-mm-dd'); if(check < today) { // previous day. show message if want otherwise nothing. // unselectable } else { // right date // } },

i hope help you.

jquery date fullcalendar

No comments:

Post a Comment