MXLCalendarManager icon indicating copy to clipboard operation
MXLCalendarManager copied to clipboard

checkDate in MXLCalendarEvent

Open Jaikant opened this issue 9 years ago • 5 comments

In my application I found an issue, wherein the method checkdate would return true for an event, even if it didn't exist for a particular date, If the event was less than 24 hours apart from the date selected.

I used the solution from here, which fixed it for me: http://stackoverflow.com/questions/12257937/get-number-of-days-between-two-nsdate-dates-in-a-particular-timezone

If this is not a real issue, then please close this.

Jaikant avatar Jun 10 '15 15:06 Jaikant

So if the current date/time is 1PM on June 10th and the event is 10AM on June 11th, checkDate would return TRUE?

KiranPanesar avatar Jun 10 '15 15:06 KiranPanesar

Hi Kiran, In my tests I removed the difference check on hours, minutes and seconds. In which case yeah the behavior you mentioned below was occurring. Regards, J.

Sent from my iPhone

On 10-Jun-2015, at 9:23 pm, Kiran Panesar [email protected] wrote:

So if the current date/time is 1PM on June 10th and the event is 10AM on June 11th, checkDate would return TRUE?

— Reply to this email directly or view it on GitHub.

Jaikant avatar Jun 10 '15 16:06 Jaikant

I can reproduce this with events with a yearly repeat frequency without end date. The logic inside checkDate (line 486 in MXLCalendarEvent.m) seems to be missing a validation on the date itself. it returns YES just for having no exception on the current date. In my opinion the given day has to be matched with the event date. If I'm right with this, i guess this is happening to monthly frequency and maybe for the weeklies too. Regards, Peter

pgrundner avatar Jun 11 '15 09:06 pgrundner

Thanks for reporting this!

@Jaikant Did you say that you'd already implemented a solution? If so, could you submit a pull request with your changes?

KiranPanesar avatar Jun 11 '15 14:06 KiranPanesar

Note that this issue is closely related to issue #5 (daylight saving time issue), that I opened on April 2014 (still open). In order to solve the problem completely, you must take into account simultaneously both the timezone AND the daylight saving time. Unfortunately, MXLCalendarManager can not be used reliably until this issues are properly solved.

cafaro avatar Jun 11 '15 15:06 cafaro