Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Time Range on a week and day view

Tags:

fullcalendar

The product I am talking about is Adam Shaws Plugin Fullcalendar

I am really pleased with this product. However I am not a code expert. I am using this calendar to display bookings. However the time rows display form 12 am onwards. Realistically I only need to show the table of entries from 8am to 10.oopm. I was wondering if this could be achieved and free up some more space to make the existing rows bigger, to enhance the display of event bookings.

like image 528
Peter Condon Avatar asked Sep 15 '10 06:09

Peter Condon


People also ask

How do I start and end date in Fullcalendar?

We can get start date by getView event with intervalStart. We can get end date by getView event with intervalEnd. var month = $('#calendar'). fullCalendar('getView').

How do I get the date from Fullcalendar?

FullCalendar's getDate returns a moment object, so you need moment's toDate() method to get date out of it. So, in you code try: console. log(currentDate.

How do I change the date on Fullcalendar?

The calendar's dates can change any time the user does the following: click the prev/next buttons, change the view, click a navlink. The dates can also change when the current-date is manipulated via the API, such as when gotoDate is called. datesSet is called after the new date range has been rendered.


2 Answers

Another update. Latest version 5 uses this syntax to allow restriction of the times shown:

...
slotMinTime: "07:00:00",
slotMaxTime: "21:00:00",
....
like image 62
Enigma Plus Avatar answered Oct 07 '22 00:10

Enigma Plus


Try using the agendaDay view with this:

$('#calendar').fullCalendar({
  minTime: "07:00:00",
  maxTime: "21:00:00"
});

minTime: Determines the first hour/time that will be displayed, even when the scrollbars have been scrolled all the way up. http://arshaw.com/fullcalendar/docs/agenda/minTime/

maxTime: Determines the last hour/time (exclusively) that will be displayed, even when the scrollbars have been scrolled all the way down. http://arshaw.com/fullcalendar/docs/agenda/maxTime/

also maybe helpful: firstHour: Determines the first hour that will be visible in the scroll pane.

Integer, default: 6 Values must be from 0-23, where 0=midnight, 1=1am, etc.

The user will be able to scroll upwards to see events before this time. If you want to prevent users from doing this, use the minTime option instead. http://arshaw.com/fullcalendar/docs/agenda/firstHour/

like image 42
orolo Avatar answered Oct 07 '22 01:10

orolo