Skip to content

Commit

Permalink
Merge pull request #1436 from nextcloud/fix-relative-time-string
Browse files Browse the repository at this point in the history
Fix relativeTimeFromDate
  • Loading branch information
Ivansss authored Dec 1, 2023
2 parents 55d515a + c4602ef commit b8997df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NextcloudTalk/NCUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ import UniformTypeIdentifiers
return NSLocalizedString("less than a minute ago", comment: "")
} else if ti < 3600 {
// This hour
let diff = round(ti / 60)
let diff = Int(round(ti / 60))
return String(format: NSLocalizedString("%d minutes ago", comment: ""), diff)
} else if ti < 86400 {
// This day
let diff = round(ti / 60 / 60)
let diff = Int(round(ti / 60 / 60))
return String(format: NSLocalizedString("%d hours ago", comment: ""), diff)
} else if ti < 86400 * 30 {
// This month
let diff = round(ti / 60 / 60 / 24)
let diff = Int(round(ti / 60 / 60 / 24))
return String(format: NSLocalizedString("%d days ago", comment: ""), diff)
}

Expand Down

0 comments on commit b8997df

Please sign in to comment.