Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can get start and end time on fullcalendar?

Tags:

how can i get start and end time of visible days in fullcalendar?

I need it for use in another javascript instace. Is there some function like -

$('calender').getStartTime(); 

?

like image 242
Pooky Avatar asked Oct 19 '10 11:10

Pooky


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 hide time in fullCalendar?

This option is available from v2. 4.0 see fullcalendar.io/docs/text/displayEventTime - You need to set it as option of fullCalendar and it affects all events. Or use CSS . fc-time{ display : none; } .

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 set events in fullCalendar?

Here is an example of how to specify an array of events: var calendar = new Calendar(calendarEl, { events: [ { title : 'event1', start : '2010-01-01' }, { title : 'event2', start : '2010-01-05', end : '2010-01-07' }, { title : 'event3', start : '2010-01-09T12:30:00', allDay : false // will make the time show } ] });


1 Answers

If you're looking for the visible start and end date, that would be the visStart and visEnd property of the view object in version 1:

$('calender').fullCalendar('getView').visStart  $('calender').fullCalendar('getView').visEnd 

and that would be intervalStart and intervalEnd in version 2:

$('calender').fullCalendar('getView').intervalStart  $('calender').fullCalendar('getView').intervalEnd 

If you're looking for the start and end date of the current week / month, that would be the start and end property of the current view object:

$('calendar').fullCalendar('getView').start  $('calendar').fullCalendar('getView').end 

Reference : Full Calendar documentation.

like image 165
Matthieu Avatar answered Oct 08 '22 15:10

Matthieu