Fullcalendar end date wrong by one day

前端 未结 10 2230
温柔的废话
温柔的废话 2020-12-06 04:42

I am making a fullCalendar backed car reservation functionality. This is the coffescript file.

    updateEvent = (event, delta, revertFunc) ->
      $.aja         


        
相关标签:
10条回答
  • 2020-12-06 05:10

    I think the key word in the directions is exclusive so whatever time you specify will not be included in the date range.

    So in your case "2014-12-21T00:00:00.000Z" would mean that the event would no longer exists at the very beginning of 12-21. If you want the event to go through 12-21 you'd want to set the end time to "2014-12-22T00:00:00.000" (first possible time in 12-22).

    0 讨论(0)
  • 2020-12-06 05:10

    I had the same issue and i finally figured out.

    I was using full day TRUE, as per the documentation if you use full day true it will behave in time.

    so first, I changed full day to FALSE, then

    in my end day I added $endDate."T23:59:00";

    This worked for me.

    0 讨论(0)
  • 2020-12-06 05:14

    I had the same problem, but i experimented with the time and that was the resolution :)

    2014-12-21T00:00:00 => 2014-12-21T23:59:00 this will solve your problem.

    0 讨论(0)
  • 2020-12-06 05:14

    In Angular Change end date time with current time, when end date time greator than 23:59:59 `

    this.calendarOptions = {
      editable: false,
      eventLimit: false,
      validRange: {
        start: '',
        end: new Date(new Date().getUTCFullYear(), new Date().getUTCMonth())
      },
      header: {
        left: '',
        center: 'title',
        right: 'prev,next'
      },
      eventSources: [
    
        // your event source
        {
          events: (start, end, timezone, callback) => {
    
            var data = [];
    
    
            data.push(new Date("2019-04-11T00:19:02"))
            data.push(new Date("2019-04-12T00:19:02"))
            data.push(new Date("2019-04-13T00:19:02"))
    
            var eventData = [];
    
            var calendarEvents: CalendarEvents = new CalendarEvents();
            calendarEvents.start = data[0];
    
            //Change end time, because of when end date time is greator than 23:59:59 then end date not marked
            var m = moment(data[data.length - 1], 'ffffd MMM D YYYY HH:mm:ss ZZ');
            m.set({ h: new Date().getHours() });
            calendarEvents.end = m.toDate();
    
            calendarEvents.allDay = false;
            eventData.push(calendarEvents);
    
            callback(eventData);
          },
          color: '#f99500',   // an option!
          textColor: 'black', // an option!
          // displayEventTime: false,
        }
        // any other sources...
    
      ],
      timeFormat: 'HH:mm'
    };
    

    `

    0 讨论(0)
提交回复
热议问题