skip to Main Content

Is there a way to apply something similar to slotMinTime (which determines the first time slot displayed for each day), but only at the beginning of my timeline?

For example, if I have a 3-day resource timeline view and set the start time to 07:00, I want my resource timeline to start from 07:00 on the first day and extend to the third day, including all other times.

If I use slotMinTime, my display will start at 07:00 on each of those 3 days and this will not work for me because I want only the first day to start at 07:00.

2

Answers


  1. Chosen as BEST ANSWER

    I made it work by changing the duration from days to hours in the resourceTimeline, for example :

    resourceTimelineTwoDays: { type: 'resourceTimeline', duration: {hours: 48}, }


  2. slotMinTime applies to each day in your view, as described in the documentation. So you cannot use that to create the display you are thinking of.

    If you are wanting to restrict the times which are available for selection, or to indicate when resources may be used, the closest you can probably get is to use the businessHours feature. You can either do this for every resource on the calendar, or have different rules for each resource.

    Using this means that although all timeslots are still visible, some of them will be greyed out to indicate they are unavailable.

    For example, if you want the first day of the week to have availability only from 7am onwards, but all other days to have 24-hour availability, you can write this:

    businessHours: [
      {
        daysOfWeek: [1],
        startTime: "07:00",
        endTime: "23:59:59"
      },
      {
        daysOfWeek: [0, 2, 3, 4, 5, 6],
        startTime: "00:00",
        endTime: "23:59:59"
      }
    ]
    

    Live demo: https://codepen.io/ADyson82/pen/dyLrVLZ

    I’m not sure if this meets your requirement sufficiently or not, as there wasn’t a lot of detail about the context in your question, but it’s possible approach you can consider, in the absence of other alternatives.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search