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

Show Business Hours on Saturday using Javascript

Asked by Patrick Burrows
10 years ago.

Using the JavaScript version of Scheduler, how can I display only business hours on a Saturday? The previously supplied answers (such as: are written using ASP.Net or MVC where there is an event argument (e) that has a property called IsVisible.

However, in Javascript, the onBeforeTimeHeaderRender event only receives an "args" argument and there is no property called Visible in that data. In fact, that event is not even fired if showNonBusiness = false is set.

I've attached an Html file which reproduces this issue.

Is there a different event to use, perhaps?

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

Hi Patrick,

In JavaScript you should use onIncludeCell event instead:


<div id="dp"></div>
<script type="text/javascript">
  var dp = new DayPilot.Scheduler("dp");
  dp.onIncludeTimeCell = function(args) {
    if (args.cell.start.getDayOfWeek() === 0) { // hide Sundays
      args.cell.visible = false;
  // ...
Comment posted by Patrick Burrows
10 years ago.

Awesome. That worked great. (maybe add that to the KB article linked above?)

Thanks so much.

Comment posted by Dan Letecky [DayPilot]
10 years ago.

Updated, thanks!

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