Dalsi kolo vylepesni /remind

This commit is contained in:
lachtan
2026-06-10 09:54:02 +02:00
parent abdfd8c67d
commit 10801da03e
5 changed files with 63 additions and 80 deletions

View File

@@ -1,6 +1,6 @@
"""Deterministic random fire-time computation for reminders.
Shared by remind_send.py (runtime) and remind_edit.py (validation). Stdlib only,
Shared by remind_send.py (runtime) and remind_cli.py (validation). Stdlib only,
so it imports cleanly regardless of the caller's uv/PEP 723 environment.
A reminder's `random` block produces `times_per_day` fire times inside a daily
@@ -81,6 +81,11 @@ def _hhmm_to_minutes(value: str) -> int:
return hours * 60 + minutes
def minutes_to_hhmm(total: int) -> str:
"""Format a minute offset (e.g. 570) as HH:MM (e.g. '09:30')."""
return f"{total // 60:02d}:{total % 60:02d}"
def _minute_to_time(total_minutes: int) -> time:
return time(total_minutes // 60, total_minutes % 60)