We have a construct where you can set the beginning of the day and the end. To get this to work I uuse dp.onIncludeTimeCell (I first used bussinessHours, but those skip saturday and sunday). It works fine until you try to set the endTime to the next day (example given 8am until 3am next day).
// start 8 end 3
if (startHours > endHours)
{
dp.days = 2;
var currentDay = parseInt(self.searchDate().format("D"));
dp.onIncludeTimeCell = function (args)
{
if (args.cell.end.getDay() != currentDay)
return args.cell.start.getHours() < endHours;
else
return args.cell.start.getHours() > startHours;
};
} else
{
dp.onIncludeTimeCell = function (args)
{
return !(args.cell.start.getHours() > endHours || args.cell.start.getHours() < startHours)
}
}
If i run through the ifs it gets the right return, however it still shows every hour (my guess is that it gets overriden when it checks the time for the current day).
Is there a way to get this to work?