nhn / tui.calendar

🍞📅A JavaScript calendar that has everything you need.
http://ui.toast.com/tui-calendar
MIT License
11.75k stars 1.26k forks source link

Events that end the following day do not show if view is changed #1355

Open fmmattioni opened 1 year ago

fmmattioni commented 1 year ago

Version 2.1.3

Test Environment

Current Behavior

If I have an event that starts on one day and ends on the following day, if I change the view to calendar.changeView('month') and then come back to the weekly view calendar.changeView('week'), that event is gone. I tried to use calendar.render() without success.

Step 1 - create calendar with needed event:

const calendar = new Calendar('#container', {
  calendars: [
    {
      id: 'cal1',
      name: 'Work',
    },
  ],
});

calendar.createEvents([
  {
    id: 'event1',
    calendarId: 'cal1',
    title: 'Weekly Meeting',
    start: '2023-01-18T22:00:00',
    end: '2023-01-19T07:00:00',
  },
]);

Step 2 - change to monthly view

calendar.changeView('month')

Step 3 - change back to weekly view and now event is gone

calendar.changeView('weekly')

Expected Behavior

I would expect the event to be still displayed on the calendar, but it is gone even trying to render the calendar again.

adhrinae commented 1 year ago

@fmmattioni

I've confirmed that it's a reproducible bug. As step 4, you can go back to the monthly view and see the event still exist.

So there would be a bug in the filtering logic inside the weekly view.

fmmattioni commented 1 year ago

Thanks @adhrinae! Is there anything I can help to fix that?

adhrinae commented 1 year ago

Starting from this file...

And this function might be the key to resolving this issue, but it takes time to analyze the problem and the code even myself.

fmmattioni commented 1 year ago

Ok, thank you - I'll take a look. This is a key feature in our application, so I'll see if I can help in fixing that.

fmmattioni commented 1 year ago

Hi @adhrinae, sorry I didn't manage to look into this yet.. do you guys have any idea on when this could potentially be fixed?