fix: sliding period window for datetime precision
After --commit with precision=datetime, last_used held from==to==now, so the next default period degenerated to a single second and showed no new time entries. Now --commit stores the real report window start and get_default_date_range() returns last_used.to..now for datetime+dynamic mode. Closes #70
This commit is contained in:
@@ -580,10 +580,9 @@ def main(argv: Optional[List[str]] = None) -> int:
|
||||
dynamic = Config._app.period_dynamic if Config._app else False
|
||||
|
||||
if precision == "datetime":
|
||||
# Сохраняем aware UTC (#58): следующий запуск вычисляет из этой
|
||||
# метки aware cutoff для дедупликации.
|
||||
now = datetime.now(timezone.utc).isoformat(timespec="seconds")
|
||||
from_str = now
|
||||
# from -- фактическое начало окна отчёта; to -- дедуп-маркер (naive UTC).
|
||||
now = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S")
|
||||
from_str = from_date
|
||||
to_str = now
|
||||
else:
|
||||
from_str = from_date
|
||||
|
||||
Reference in New Issue
Block a user