Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkDate in MXLCalendarEvent #17

Open
Jaikant opened this issue Jun 10, 2015 · 5 comments
Open

checkDate in MXLCalendarEvent #17

Jaikant opened this issue Jun 10, 2015 · 5 comments

Comments

@Jaikant
Copy link

Jaikant commented Jun 10, 2015

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.

@KiranPanesar
Copy link
Owner

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

@Jaikant
Copy link
Author

Jaikant commented Jun 10, 2015

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 notifications@github.com 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.

@pgrundner
Copy link

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

@KiranPanesar
Copy link
Owner

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?

@cafaro
Copy link

cafaro commented Jun 11, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants