2
votes

In the Week View, if I select a time period, how do I get the selected time, on the click of a button. Is there a function to call like, getTime or something? I can get the selected day, by doing something like:

var start = $('#calendar').fullCalendar('getView').visStart;

however, not sure how to get the selected time.

2

2 Answers

1
votes

I think the select callback works better than dayClick, because you can get the start date if a range of dates were selected.

select: function(startDate, endDate, allDay, jsEvent, view) {
  // here startDate and endDate will give you the date-range selected
}
0
votes

visStart property only keeps date object of the first visible day.

If you want get clicked date and time you may use dayClick event:

dayClick: function(date, allDay, jsEvent, view) {
    //some code here
}

which has date as date object