Ionic2-Calendar icon indicating copy to clipboard operation
Ionic2-Calendar copied to clipboard

Problem with overlap detection between events

Open baeteja opened this issue 5 years ago • 2 comments

I'm using this calendar for a simple time logging application. However, I'm currently facing the following issue:

When 2 bookings are logged on the same day it sometimes falsely detects an overlap. For example the following bookings should not be displayed as an overlap:

image

The first one ends at 12:40 and the second one starts at 12:40. If I change the time to 12:45 it displays correctly

image

Am I missing something here? Is there anyway to fix this issue?

baeteja avatar Oct 24 '19 04:10 baeteja

@baeteja The end time of the first event should be 12:39, then they are considered not overlapped. I need to leave some buffer during the overlap calculation, because of the float number precision.

twinssbc avatar Oct 25 '19 12:10 twinssbc

I'm having the same issue. It indeed seems like there is a floating point precision issue here.

Would it be an idea to introduce an overlapThreshold option/setting for this? Or at least update the calculation to ignore overlaps if the time difference is negligible (i.e. due to floating point precision)?

I've tried decreasing the step size, but that didn't help unfortunately.

Your help is much appreciated!

WouterWidgets avatar Apr 30 '24 09:04 WouterWidgets