mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-10-01 15:13:11 +00:00
docs(meals): clarify week-key dual-read is same-instant (PLAT-134)
This commit is contained in:
parent
216860b82c
commit
0566722e96
2 changed files with 7 additions and 0 deletions
|
|
@ -24,6 +24,12 @@ def week_id_iso(dt: datetime) -> str:
|
|||
|
||||
|
||||
def candidate_week_ids(dt: datetime) -> tuple[str, ...]:
|
||||
"""Return U-week then ISO encodings of the same instant.
|
||||
|
||||
Dual-read does not advance the calendar week. ``%Y-W%U`` and ``%G-W%V``
|
||||
are two strftime renderings of ``dt``. Example: 2026-01-01 encodes as
|
||||
("2026-W00", "2026-W01"), not as "this week" then "next week".
|
||||
"""
|
||||
u_week = week_id_ustrftime(dt)
|
||||
iso_week = week_id_iso(dt)
|
||||
if u_week == iso_week:
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ def test_ustrftime_and_iso_differ_on_new_year():
|
|||
|
||||
|
||||
def test_candidate_week_ids_u_week_first_then_iso():
|
||||
# 2026-01-01: same instant encoded two ways, not a next-week lookup.
|
||||
assert candidate_week_ids(MISMATCH_DT) == ("2026-W00", "2026-W01")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue