Search code examples
javascriptangularjsfullcalendarangular-ui

ui-calender : event not including end date if time is less than 9 am


I am using angular ui calendar plugin which uses fullcalendar to display events on a calendar. I am encountering a bizare result. If the the event ends before 9 am the end date is not included by the event rendered.

These are my two events :

 $scope.staticEvents = [
    {
      title: 'Static 1', 
    end: new Date(2015, 10, 30, 8, 30, 0, 0),
    start: new Date(2015, 10, 26, 8, 0, 0, 0)

    },
     {
       title: 'Static 2', 
      end: new Date(2015, 10, 30, 9, 0, 0, 0),
      start: new Date(2015, 10, 26, 8, 0, 0, 0)
      }
  ];

please find the code here : plunker

How to include the end date of the event in this scenario ? Is anything missing in the code ?

Thank you.


Solution

  • This is because the nextDayThreshold is set to 9 AM by default in fullCalendar. You need to reset it to 12 AM.

    More info here

    You set this option in your controller like this:

    $scope.uiConfig = {
      calendar:{
      nextDayThreshold:'00:00:00'
      }
    };