0

I am using fullCalendar. Right now I have only single day time slot avalible for example 0 to 24hrs.

Instead I want a custom time slot of 24 hours if possible, for example today 9am to the next day at 9am.

ADyson
  • 57,178
  • 14
  • 51
  • 63

1 Answers1

0

Assuming you are using the Resource Timeline view, you can do it like this, for example:

initialView: "resourceTimelineWeek",
slotDuration: { hours: 24 },
slotMinTime: "09:00",

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

ADyson
  • 57,178
  • 14
  • 51
  • 63
  • I am using timegrid view here is the link https://fullcalendar.io/docs/timegrid-view on the right sidebar i want the time slot of 9AM to next day 9 Am 24 hours slot not an single day slot – ankit microlent Sep 01 '23 at 14:31
  • Ok. Well timegrid, as you can see, strictly puts each day in a separate vertical column, so it doesn't really work properly or make any sense in that context - I've updated the demo at https://codepen.io/ADyson82/pen/yLGJvwa so you can see a timegrid resource view with the same 9am and 24-hour timeslot settings. One of the events isn't even displayed. It isn't practical or logical to achieve your requirement using that type of view, it strictly separates each day into different parts of the view, it cannot cope with one continuous timeslot going across different days – ADyson Sep 01 '23 at 14:49
  • Calendar is used for bookings in rooms. Ultimate objective is for example to allow user to make a booking 23.30 that lasts 90 minutes so end time is 01.00 - Practically is another day after 00.00 but we want to display it on the same calendar date. Any suggestion? – ankit microlent Sep 01 '23 at 15:57
  • Yes, the suggestion is to use the timeline view. It cannot ever work like that with timegrid – ADyson Sep 01 '23 at 16:31