0

I am using the jquery full calendar plugin, to display the workers day off. For example: User ID-2 is on holiday from 2019-01-10 to 2019-01-10.

On the calendar, the end data is always display woring. If the end is 2019-01-10, it will display it on 2019-01-09.

I upload a photo from date calendar, and the sql table.

var hossz = 0;
var valami = [];
var eventArray = [];
$.ajax({
    type: "POST",
    url: "files/get_events.php",
    dataType: "json",
    success: function(data) {
        eventArray = data;
        hossz = eventArray.szabi_id.length;
        for (i = 0; i < hossz; i++) 
        {

            valami.push({
                title: eventArray.szabi_user[i],
                backgroundColor: eventArray.user_color[i],
                start: eventArray.szabi_from[i],
                end: eventArray.szabi_to[i],
                url: '/szabi-szerkesztes/' + eventArray.szabi_id[i]
            });



        }
        $('#calendar').fullCalendar({
            events: valami,
            lang: 'hu',
            dayClick: function(event) {
                $(cell).removeClass('ui-widget-content');
                $(cell).addClass('holiday');
                $(this).css('background-color', 'green');
            },
            defaultView: 'month',
            contentHeight: 'auto',
            slotEventOverlap: false
        });
    }
});

Data displayed on calendar

Sql data image

max777
  • 143
  • 5
  • 18
  • 2
    Possible duplicate of [Fullcalendar end date wrong by one day](https://stackoverflow.com/questions/27407052/fullcalendar-end-date-wrong-by-one-day) – jdickel Jan 04 '19 at 13:27

1 Answers1

1

If you only use the Date without Time it‘s exclusive for Fullcalendar.js. Either you use the Date and add one second or you simply add one day to the Date.

jdickel
  • 1,437
  • 1
  • 11
  • 21