Skip to content

Add quick due date preset buttons to task creation#316

Merged
felixevers merged 1 commit into
mainfrom
claude/task-quick-date-buttons-2veh2q
Jul 5, 2026
Merged

Add quick due date preset buttons to task creation#316
felixevers merged 1 commit into
mainfrom
claude/task-quick-date-buttons-2veh2q

Conversation

@felixevers

Copy link
Copy Markdown
Member

What

Adds two rows of small preset buttons below the due date input in the task creation drawer:

  • Datetime presets: Now, +1 hour, +3 hours, +6 hours, +12 hours, +24 hours — set a full datetime due date (seconds zeroed, current time plus offset).
  • Date-only presets: Today, Tomorrow, +2 days, +4 days — set a date-only due date using the existing end-of-day sentinel (23:59:59.999), so the input switches to date mode without a time.

The due date stays empty by default; a value is only set when a preset is clicked or entered manually. The buttons appear only in create mode, not when editing an existing task.

How

  • New DueDateQuickSelect component (web/components/tasks/DueDateQuickSelect.tsx) using hightide Button size="xs" with flex-wrap rows so they wrap cleanly on mobile.
  • New DueDateUtils.dateTimeInHours / DueDateUtils.dateOnlyInDays helpers that compute the preset in the configured app timezone (RUNTIME_TIMEZONE), matching the existing parseFromApi/serializeForApi wall-clock convention.
  • TaskDataEditor remounts the FlexibleDateTimeInput (keyed by a click counter) when a preset is applied, since the input derives its date/dateTime mode only on mount — same pattern the edit mode already uses.
  • New translation keys (dueDateNow, dueDateToday, dueDateTomorrow, dueDateInHours, dueDateInDays) added to all six locales with ICU plurals; translations.ts regenerated via npm run build-intl.

Validation

  • npm run lint (tsc + eslint): passes (one pre-existing unrelated warning in PatientList.tsx).
  • npm test: 150 tests pass, including new unit tests for the preset helpers (timezone handling, day/month rollover, sentinel invariants).
  • npm run check-translations: all keys exist in every locale.
  • Verified in a Chromium browser at 375px (mobile) and 1280px (desktop): due date starts empty, datetime presets fill date + time, date presets fill date-only, buttons wrap with no horizontal overflow. Mobile screenshots:
Datetime preset (+3 hours) Date-only preset (Tomorrow)
input shows 07/05/2026 - 15:27 in dateTime mode input shows 07/06/2026 in date mode

🤖 Generated with Claude Code

https://claude.ai/code/session_011FUW7ckxf9AFki2eubR3sX


Generated by Claude Code

Adds a row of small preset buttons below the due date input in the
task creation drawer: Now, +1/+3/+6/+12/+24 hours set a datetime due
date, while Today, Tomorrow, +2/+4 days set a date-only due date
(end-of-day sentinel). The due date stays empty until a preset is
clicked or a value is entered manually. Presets are computed in the
configured app timezone and the buttons wrap on narrow viewports.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011FUW7ckxf9AFki2eubR3sX
@felixevers felixevers merged commit 52c030c into main Jul 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants