Skip to content

mt_dateFromYear:week:weekday returns unexpected values #8

Open
@averydev

Description

@averydev

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:

    NSDate *testDate = [NSDate mt_startOfToday];
    NSLog(@"Checking week of year = %ld",[testDate mt_weekOfYear]);
//Output: Checking week of year = 1

Some other related oddities
[NSDate mt_dateFromYear:2014 week:1 weekday:1] returns 12/28/14
[NSDate mt_dateFromYear:2014 week:2 weekday:1] returns 1/5/14 This is as I would expect it.

[NSDate mt_dateFromYear:2014 week:1 weekday:6] returns 1/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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions