mirror of
https://github.com/tiennm99/time-mocker.git
synced 2026-09-18 14:20:34 +00:00
Replace the six DragValue spinboxes (year/month/day/hour/minute/second) with a single datetime button that opens one popup containing: - month-navigable calendar grid (chevrons clamp at MIN_YEAR-01 / MAX_YEAR-12) - 6x7 day grid via chrono::NaiveDate arithmetic; out-of-month cells dimmed and jump-to-month on click; today gets a 1px outline; selected day filled - HH:MM:SS DragValues for time (same control style as before) - quick-select row: Now / Midnight / Noon / -1d / +1d - right-aligned Apply primary action; Esc and click-outside close without committing (CloseOnClickOutside + manual Esc capture) Top bar reduces to [Mock Time] [datetime ▼] [Now] Δ = +X.Xs. The Set button is gone — Apply (inside the popup) is the only commit path now. picker_view_year/month is decoupled from fake_*, so chevroning months does not move the selection; opening the popup re-syncs the view to the current fake_year/month. Drop the now-dead pub(crate) fn days_in_month and its 10 tests — the new calendar grid uses chrono's Duration::days and cell_date.day() directly, both of which are self-clamping. apply_fake_time, picked_naive_dt, unix_micros_to_filetime_ticks, and the DST/overflow status_msg flow are unchanged.