kalend
kalend copied to clipboard
Agenda and Calendar view display event in the wrong day
In Agend and Calendar view, events that are close to end of day are displayed on the next day instead. The bug happens when you create a bug within the timezone offset of the range. The event is displayed correctly (right start and end times), but the event is on the next day.
To Reproduce Steps to reproduce the behavior:
- Create a Kalend component with the desired Timezone (i.e 4 hours offset)
- Add event with the same timezone withing this offset (i.e. for 4 hours offset, create it between 8 PM and Midnight)
- In Agenda/Calendar view, the events shows up on the wrong date
Expected behavior The event should always be converted to the specified timezone (Kalend timezone param) and should show up in the correct day for those two views.
Screenshots
In this example, event is on the 25th from 10 PM to 11 PM for a timezone with 4 hours offset.
Desktop (please complete the following information):
- OS: MacOS, Windows
- Browser: Chrome
- Version: 0.15.0
Smartphone (please complete the following information):
- Device: Samsung Galaxy A71 , iPhone 12
- OS: Android, iOS
- Browser: Chrome
- Version: 0.15.0
Additional context
After looking through your code, it might be that the problem is in validations like isTodayOrInFuture
What I did to work around this issue
- Force current timezone or UTC to the Kalend component
- Force current timezone or UTC to the events
- Tried passing luxon for event date instead of our usual date lib
Hi,
thank you, I was able to replicate bug when creating new event. I fixed some problems, but knowing how timezones could be tricky, I believe it might take some more tweaking to make this right for all cases.
Could you please check new version 0.15.1, if you see improvement?
I guess I also ran into that problem.
When displaying a e.g. 2-day all day event, the follow-up day of day 2 is also covered by the event. Here is a reproducible example.
In contrast to @the-spelletier use case, I also tried to specify the dates in UTC timezone. E.g.
{
id: 1,
startAt: "2022-08-25T00:00:00.000Z",
endAt: "2022-08-26T23:59:59.999Z",
timezoneStartAt: "UTC",
timezoneEndAt: "UTC",
summary: "2 days",
color: "orange",
calendarID: "simple",
allDay: true
}
renders the event on the 25th, 26th, and 27th, which is wrong.
By playing around a little bit, I recognized that the "magical" time line is at 11:59:59.999
. So endAt: "2022-08-26T11:59:59.999Z"
renders the event correctly and from endAt: "2022-08-26T12:00:00.000Z"
on it is rendered wrong.
Kalend version is 0.15.1
.
Edit: As it can be seen with the reproducible example, for single day all day events the issue does not occur.
Thank you for examples. This case should be fixed in new version.