search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Navigator past months / block future dates

Asked by JDEC
4 years ago.

Hello,

I would like to show the past month and the current month for the navigator and potentially block future dates in the calendar & navigator. I plan to use the tool as a way for the employees to report the hours done during the past weeks.

Is there a way to do this built inside the tool ?

Thanks much !!

Answer posted by Dan Letecky [DayPilot]
4 years ago.

Yes, this is possible. You can hook the onTimeRangeSelect event handler and forbid navigating to the selected dates. Please see the following tutorial:

https://code.daypilot.org/88013/javascript-calendar-blocking-selected-dates

Answer posted by FM
4 years ago.

Thanks the tip.

Effective on the live demo but not on my PC. The css class "navigator-disabled-cell" does not seem to be found.
I disabled the cells on the calendar with the same kind of conditions:
if (args.cell.start.getDatePart() > DayPilot.Date.today()) {args.cell.disabled = true;}
but the navigator cells are still active.

On my 2nd question: how to display 2 navigators: one for the previous month and one for the current month ?
nav.showMonths = 2 and nav.skipMonths = 2 result in showing the current and future months.

Thanks again

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.