fix #3622
Some checks failed
Release 3X-UI / build (386) (push) Has been cancelled
Release 3X-UI / build (amd64) (push) Has been cancelled
Release 3X-UI / build (arm64) (push) Has been cancelled
Release 3X-UI / build (armv5) (push) Has been cancelled
Release 3X-UI / build (armv6) (push) Has been cancelled
Release 3X-UI / build (armv7) (push) Has been cancelled
Release 3X-UI / build (s390x) (push) Has been cancelled
Release 3X-UI / Build for Windows (push) Has been cancelled

This commit is contained in:
MHSanaei 2026-01-03 22:31:31 +01:00
parent a6b3623634
commit 3f15d21f13
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A

View file

@ -908,7 +908,10 @@ class IntlUtil {
const language = LanguageManager.getLanguage() const language = LanguageManager.getLanguage()
const now = new Date() 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' }) const formatter = new Intl.RelativeTimeFormat(language, { numeric: 'auto' })
return formatter.format(diff, 'day'); return formatter.format(diff, 'day');