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

Setting heightSpec: "BusinessHoursNoScroll" resets hours shown on grid

Asked by Anonymous
5 months ago.

Hello,

I am using DayPilot Lite with Angular.
I have set the business start and end hours (9.00-18.00) in a config variable, i.e:

config: DayPilot.CalendarConfig = {
    businessBeginsHour: 9,
    businessEndsHour: 18
}

I don't want the user to be able to view any other hours, so have set heightSpec to "BusinessHoursNoScroll".
This however has caused the hours in the grid to reset to 00.00-08.00.
If I set heightSpec to "BusinessHours" then the correct hours (09.00-18.00) are highlighted, but the user is able to scroll up and down.
I saw in the docs that there should also be dayBeginsHour and dayEndsHour properties available, but they are not present in the DayPilot Lite version I have (I installed with npm so assuming I have the latest version..)

Please let me know if I'm missing something, or if this is a bug.

Thanks!

Comment posted by Dan Letecky [DayPilot]
5 months ago.

At this moment, this option (heightSpec: "BusinessHoursNoScroll") is not supported in the Lite version (see also https://doc.daypilot.org/calendar/height/).

It will most likely appear in one of the future releases. For now, you can achieve a similar effect using hideFreeCells property:

config: DayPilot.CalendarConfig = {
  hideFreeCells: true,
  // ...
}

See also:
https://doc.daypilot.org/calendar/hidefreecells/

Comment posted by Anonymous
5 months ago.

Thanks for your reply!
I'm getting an error for hideFreeCells:
"'hideFreeCells' does not exist in type 'CalendarConfig'".

In the doc you linked to it says that in Lite this property is only available for DayPilot for ASP.NET WebForms. Is there any other way of achieving this in Javascript?

Comment posted by Dan Letecky [DayPilot]
5 months ago.

Sorry, you are right. Please let me check the status of the "BusinessHoursNoScroll" support in the Lite version.

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

The support for heightSpec: "BusinessHoursNoScroll" is now implemented in the latest sandbox build and it will be available in the next release.

Comment posted by Anonymous
5 months ago.

Thank you!

Comment posted by Dan Letecky [DayPilot]
5 months ago.

The new release with this update is now available:
https://javascript.daypilot.org/daypilot-lite-for-javascript-2022-2-369/

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