mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-20 21:00:36 +01:00
fix: date components unwrap issue. resolve #278
This commit is contained in:
parent
c429b229e4
commit
5c64b759ee
@ -49,7 +49,7 @@ extension Date {
|
||||
let earlierDate = date < self ? date : self
|
||||
let latestDate = earlierDate == date ? self : date
|
||||
|
||||
let components = Calendar.current.dateComponents([.year, .month, .day, .minute, .second], from: earlierDate, to: latestDate)
|
||||
let components = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: earlierDate, to: latestDate)
|
||||
|
||||
if components.year! > 0 {
|
||||
return L10n.Date.Year.left(components.second!)
|
||||
|
Loading…
Reference in New Issue
Block a user