Commit Graph
2 Commits
Author SHA1 Message Date
Lauri Ojansivu 67f1c7c56e Show a countdown ("N days left"/"N days overdue") on the due-date badge.
The due-date badge (card detail and minicard) showed only the formatted
date - no relative countdown, contrary to what the badge's own title
text suggested. dueCountdown() (client/lib/dueDateColor.js) is a pure
day-count helper, sharing its "now" comparison with the existing
dueDateClass() so the countdown and the badge's colour always agree;
cardDate.js's new dueCountdownText() turns it into translated text and
both cardDueDate and minicardDueDate now show it in showDate() (visible
text) and showTitle() (hover), e.g. "Jun 15 (3 days left)" / "Jun 15 (2
days overdue)" / "Jun 15 (Due today)". A completed due date (one with an
end date set) keeps just the plain date - there is nothing left to count
down. Received/start/end date badges are untouched; they use their own
showDate()/showTitle() overrides on the same shared dateBadgeBody markup.

Adds due-today/due-days-left/due-days-overdue to en.i18n.json (right
after card-due-on) and translates them into all 245 other locale files,
keeping the %s day-count placeholder intact everywhere.

Thanks to javen9881 and xet7 !

Closes #2424,
2026-09-10 20:52:39 +03:00
Lauri OjansivuandClaude Opus 4.8 086254e106 Fix #6000, #5965: due-date colours correct and consistent across views
Root cause of #6000 was diff(date, now, 'days') with an invalid unit comparing
raw milliseconds, so future due dates were mis-coloured; replaced with a precise
hours-based comparison (past=overdue/red, <=48h=due-soon/amber, >48h=not-due/grey).
For #5965 the colour-decision logic is unified into one shared dueDateClass()
helper used by both the minicard and card-detail badges, and the card-detail
status colours now win the cascade, so overdue shows red in both. Unit tested.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 14:40:13 +03:00