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

Custom weekend days

Asked by Vlad
7 years ago.

Dear Sir/Madam,

I would like to change the weekend days from Saturday and Sunday to Friday and Saturday. In addition I want those days to be hidden along with the non-working hours.

So far I have tried using these settings:
dp.showNonBusiness = false;
dp.businessWeekends = false;

Together with this event:
dp.onBeforeCellRender = function (args) {
//MAKE every FRIDAY AND SATURDAY working days and every SUNDAY non working
if (args.cell.start.getDayOfWeek() == 5 || args.cell.start.getDayOfWeek() == 6) {
args.cell.business = false;
}
else {
args.cell.business = true;
}
};

However, setting the day to non business only applies a custom css class and grays the cells out, it does not consider this day a weekend.

Any help would be appreciated!

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

The onBeforeCellRender applies the properties (business/non-business) to grid cells. The business status can be set for each cell separately and it's possible that cells in the same column will not have the same business status. That's why the cell business status is not used for hiding columns.

There is another event that use can use to hide custom columns: onIncludeTimeCell.
See also: https://doc.daypilot.org/scheduler/hiding-time-columns/

Another option is to create the timeline manually:
https://doc.daypilot.org/scheduler/timeline/

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