-
Notifications
You must be signed in to change notification settings - Fork 952
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
timeAgo doubtful result #243
Comments
I'm having the same issue. Looks like the current date doesn't fall into this condition:
In my case |
+1. Looking at the code, it defines
But I think it should actually be defining
At least for me, when I made that change, stuff started working correctly. I'll be submitting a PR shortly - hope @MatthewYork's recent resurgence in activity on this library means he'll be amenable to it! |
yep ive noticed the same problem. some sample data: Test Case: let oldEpoch = 1625693136.000 // Jul 7, 2021 5:25 PM
let currentEpoch = 1625862719.98203 // Jul 9, 2021 4:31 PM
let oldDate = Date(timeIntervalSince1970: oldEpoch)
let newDate = Date(timeIntervalSince1970: currentEpoch)
print(oldDate.timeAgo(since: newDate)) // prints 23 hours am I losing my mind? Shouldn't it be 1 day 23 hours? |
Hi! First of all — thanks for such an awesome project!
I've faced an issue where given date:
with timeAgoSinceNow produces this result:
Now is:
And in components calculated inside
public func timeAgo(since date:Date, numericDates: Bool = false, numericTimes: Bool = false) -> String
function i see this:So i'm a bit confused, should timeAgo be represented as
1 day 23 hours ago
or even2 days ago
? Is this an expected behavior or this is a bug?Would appreciate any help, thanks!
The text was updated successfully, but these errors were encountered: