Merge pull request #280 from mastodon/fix/issue-278

Fix date components issue
This commit is contained in:
CMK 2021-08-11 11:37:50 +08:00 committed by GitHub
commit 081df6ba86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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!)