2

Good day, can any-one solved this problem?

I want to change the layout of the internval time from 00:00:00 - 23:59:00 to 19:00:00 - 06:59:00? The reason is for the night shift peeps out there. haha.

I saw same question click here, and the answer is not possible. But that is 4years ago.

I hope there's a solution for this in v4 of fullcalendar.

ADyson
  • 57,178
  • 14
  • 51
  • 63
Nosaj
  • 51
  • 8
  • No, there's still no solution - the timeGrid view is still built on the same assumption, that it covers a period within a single day. I haven't tried but you _might_ be able to make it work using the (more flexible) `timeline` view, and the `visibleRange` setting. See https://fullcalendar.io/docs/timeline-view, https://fullcalendar.io/docs/timeline-view-no-resources, https://fullcalendar.io/docs/visibleRange – ADyson Jan 22 '20 at 08:37
  • P.S. changed your tags because fullCalendar 4 is not written as a jquery plugin anymore :-) – ADyson Jan 22 '20 at 08:39
  • No problem. If you make it work using timeline view, maybe post your answer here so others can benefit from the idea :-) (you are allowed to answer your own question!) – ADyson Jan 23 '20 at 09:22

1 Answers1

1

I found an alternative solution for this.

I just add min and max time for the calendar option.

minTime: '18:00:00',
maxTime: '30:00:00',

so the output will be from 6:00 pm to 7:00 am

note: just add your mintime by how many hours you want your calendar will be.

In my example. i just want my calendar be 6pm to 7am therefore i will just my minTime(18:00) by 13 hours therefore the input for maxTime will be 30:00

see below image for the result:

Calendar view

I hope this will help others.

also correct me if this is a bad practice for this problem. :) thank you

Simson
  • 3,373
  • 2
  • 24
  • 38
Nosaj
  • 51
  • 8