yannickl / YLMoment

Parsing, validating, manipulating, and formatting dates easily in Objective-C (API inspired by moment.js)

Home Page:http://yannickl.github.io/YLMoment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`isBeforeMoment` / `isAfterMoment` / `isBetweenMoments` are broken

sndrm opened this issue · comments

commented

Example :

YLMoment *m1 = [YLMoment momentWithDateAsString:@"01/01/2016 01:00:00" format:@"dd/MM/yyyy hh:mm:ss"];
YLMoment *m2 = [YLMoment momentWithDateAsString:@"01/01/2017 00:00:00" format:@"dd/MM/yyyy hh:mm:ss"];

[m1 isBeforeMoment:m2] // Should be true but it's false because the hour component from second moment is smaller than the one from first moment

isAfterMoment and isBetweenMoments are broken too because they use isBeforeMoment to work

@syndr0m-sxb Thanks for finding this, should be fixed now.