-
Notifications
You must be signed in to change notification settings - Fork 28
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
mt_dateFromYear:week:weekday returns unexpected values #8
Comments
Twitter went down yesterday for a related issue (their servers thought it was 2015, so all oauth tokens were invalidated and couldn't be renewed). Very interesting. |
I still haven’t gotten a chance to look at what is causing this, and though it’s possible that it is something deep in date management, but I think it's unlikely because I am getting correct dates when I add 7 days, but not when I add 1 week (or anything relating to weeks). While poking around I noticed that for instance mt_oneWeekNext does this
But then,
In the weeks component uses:
It's possible that this is just a weeks problem, not a date problem generally. To add weeks, it's possible that one would need to use When I'm done with my current deadline I'd be happy to take a deeper look, I just noticed this in passing. |
As a hint, the problem is most likely gonna be in the MTDates library, not the MTPDF lib |
I happened to notice, because it's the 28th of December, but there is something odd happening with the week number of the year. Specifically it seems to think that this week is week 1:
Some other related oddities
[NSDate mt_dateFromYear:2014 week:1 weekday:1]
returns12/28/14
[NSDate mt_dateFromYear:2014 week:2 weekday:1]
returns1/5/14
This is as I would expect it.[NSDate mt_dateFromYear:2014 week:1 weekday:6]
returns1/2/15
which is pretty wild.I haven't gotten a chance to dig in and see what's going on, but figure'd I would start off and post an issue.
Thanks for the great library, it's a lifesaver!
The text was updated successfully, but these errors were encountered: