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

Calendar control; showing only busniess hours

Asked by Acrobat
4 months ago.

Is it possible to show only business hours in calendar control, with open source daypilot?

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

The MVC Lite (open-source) version is no longer under active development.

I recommend switching to the JavaScript Lite version. The JavaScript version lets you set the Calendar height to show only business hours using the heightSpec property (heightSpec: "BusinessHoursNoScroll").

Comment posted by Acrobat
3 months ago.

I’m a beginner and this is my first time to use daypilot calendar.

I want to hide nonbusiness hours. I’m using version: 2023.4.504-lite

When I add heightSpec: "BusinessHoursNoScroll" to bellow code,

hours values are reset to 12am to 7am.

Any sugesstions?

<script src="~/lib/daypilot/daypilot-all.min.js"></script>

<div id="dp"></div>

<script>
    const dp = new DayPilot.Calendar("dp", {
        viewType: "Day",
    });

    dp.businessBeginsHour = 7;
    dp.businessEndsHour = 15;

    dp.init();
</script>
Comment posted by Dan Letecky [DayPilot]
3 months ago.

You may be accidentally using an older version of DayPilot. It should work fine in version 2023.4.504-lite.

There is now an online demo that shows the behavior:

Please let me know if the problem persists.

Comment posted by Acrobat
3 months ago.

It works with daypilot-lite-javascript-2024.1.517. Probably some mine mistake.

Dan Letecky, thank you for your time and effort.

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