MatthewYork / DateTools

Dates and times made easy in iOS
MIT License
7.22k stars 952 forks source link

Is it possible to change how timeAgoSinceDate works with a parameter? #272

Open jlubeck opened 6 years ago

jlubeck commented 6 years ago

Hi! Thanks a lot for this library, I've used it in countless projects!

But now I got a specific requirement. When using timeAgoSinceDate, I need to make the switch between minutes and hours after 120 minutes instead of the current 60 mins.

Ex: Now, if the difference is 70 minutes, it currently displays "1 hour ago"

I'd like for it to display 70 minutes ago. And only start with hours after the 2hr hit.

Is that possible?

Thanks!

jlubeck commented 6 years ago

Mmm... looking at the source code, looks like it's not currently possible. More than willing to do it myself, would a pull request for this be accepted?

jlubeck commented 6 years ago

Ok, not sure if it's the best way to do it, but just sent a pull request that handles this...