fix(project): 주간 회의록 1주차 = 그 달 첫 월요일이 있는 주(월간 목표·누적은 1일~말일)

- store.month_weeks: 주는 월요일이 속한 달의 것 — 예) 2026년 10월 = 10/5·12·19·26, 9/28~10/4 는 9월 마지막 주
- 다른 달의 주(?week=)를 열면 그 달 회의록으로 303
- 작은 달력은 그 달 날짜가 든 주 전부(store.calendar_weeks) — 앞 달 주는 흐리게, 누르면 그 달 회의록
- 월 누적·주당 필요 매출은 그대로 1일~말일 기준(1주차면 첫 월요일 전날까지 누적), 캐시 버전 20261001r, 문서 갱신

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 14:54:30 +09:00
parent 5460c7f676
commit 9161e0901f
12 changed files with 68 additions and 25 deletions
+18 -2
View File
@@ -545,10 +545,26 @@ def week_monday(d: date) -> date:
return d - timedelta(days=d.weekday())
def month_last_day(year: int, month: int) -> date:
return date(year + (month == 12), month % 12 + 1, 1) - timedelta(days=1)
def month_weeks(year: int, month: int) -> list[tuple[date, date]]:
"""그 달과 겹치는 주(월요일~일요일) 목록 — 1주차 = 1일이 들어 있는 주."""
"""그 달의 주(월요일~일요일) 목록 — **1주차 = 그 달 첫 월요일이 있는 주**, 주는 월요일이 속한 달의 것
(2026-10-01 사용자 기준). 예: 2026년 10월 = 10/5·12·19·26 주, 9/28~10/4 주는 9월 마지막 주.
월간 목표·누적은 이와 따로 늘 1일~말일."""
first = date(year, month, 1)
last = (date(year + (month == 12), month % 12 + 1, 1) - timedelta(days=1))
last = month_last_day(year, month)
out, mon = [], first + timedelta(days=(7 - first.weekday()) % 7)
while mon <= last:
out.append((mon, mon + timedelta(days=6)))
mon += timedelta(days=7)
return out
def calendar_weeks(year: int, month: int) -> list[tuple[date, date]]:
"""작은 달력용 — 그 달 날짜가 하나라도 든 주(월요일 시작) 전부(1일이 든 주부터 말일이 든 주까지)."""
first, last = date(year, month, 1), month_last_day(year, month)
out, mon = [], week_monday(first)
while mon <= last:
out.append((mon, mon + timedelta(days=6)))