diff --git a/CHANGELOG.md b/CHANGELOG.md index ad3a837..9c0dc73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. This projec - Mobile admin shell and lists: wide tables no longer expand/clip the page. The shared ScrollArea constrains content width, tables scroll horizontally inside their card, and list Create / pagination actions stay visible in the mobile viewport. - Form and detail layouts wrap more cleanly on narrow screens (action bars, label/value rows). - Date/time picker in dark mode: replaced the native time input (invisible clock icon + always-light popup) with themed hour/minute selects and a visible Clock icon; set `color-scheme` on light/dark themes so remaining native date controls follow the UI. +- Empty date/time fields open prefilled with the current date and time so the calendar and hour/minute selects start on a useful default. ### Changed - Negative account disk-usage values (stale Stalwart quota counters) are shown in red with an info tooltip that explains how to recalculate usage via Tasks (Perform account maintenance operations → Recalculate storage quota usage, or store-wide Reset all user quotas). diff --git a/src/components/forms/FieldWidget.tsx b/src/components/forms/FieldWidget.tsx index a0819b4..88e70cc 100644 --- a/src/components/forms/FieldWidget.tsx +++ b/src/components/forms/FieldWidget.tsx @@ -924,6 +924,19 @@ function DateTimeField({ value, onChange, readOnly, nullable }: DateTimeFieldPro onChange(next.toISOString()); }; + const formatClock = (d: Date): string => + `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`; + + /** Empty fields open on "now" so the calendar and time selects start useful. */ + const handleOpenChange = (next: boolean) => { + setOpen(next); + if (next && !parsed) { + const now = new Date(); + now.setSeconds(0, 0); + onChange(now.toISOString()); + } + }; + if (readOnly) { if (!strValue) { return {t('field.notSet', 'Not set')}; @@ -944,7 +957,7 @@ function DateTimeField({ value, onChange, readOnly, nullable }: DateTimeFieldPro return (
- +