notifs: wrap time to days

This commit is contained in:
2 * r + 2 * t 2025-09-22 23:57:09 +10:00
parent 38b9b86595
commit 1dad7d52ea

View file

@ -139,13 +139,18 @@ Singleton {
readonly property string timeStr: { readonly property string timeStr: {
const diff = Time.date.getTime() - time.getTime(); const diff = Time.date.getTime() - time.getTime();
const m = Math.floor(diff / 60000); const m = Math.floor(diff / 60000);
const h = Math.floor(m / 60);
if (h < 1 && m < 1) if (m < 1)
return "now"; return qsTr("now");
if (h < 1)
return `${m}m`; const h = Math.floor(m / 60);
return `${h}h`; const d = Math.floor(h / 24);
if (d > 0)
return `${d}d`;
if (h > 0)
return `${h}h`;
return `${m}m`;
} }
property Notification notification property Notification notification