This commit is contained in:
MHSanaei
2026-01-03 22:31:31 +01:00
parent a6b3623634
commit 3f15d21f13

View File

@@ -908,7 +908,10 @@ class IntlUtil {
const language = LanguageManager.getLanguage()
const now = new Date()
const diff = Math.round((date - now) / (1000 * 60 * 60 * 24))
// Handle delayed start (negative expiryTime values)
const diff = date < 0
? Math.round(date / (1000 * 60 * 60 * 24))
: Math.round((date - now) / (1000 * 60 * 60 * 24))
const formatter = new Intl.RelativeTimeFormat(language, { numeric: 'auto' })
return formatter.format(diff, 'day');