Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Fixhancement: change date calculation for 'this year' to include future documents (#11884)

shamoon5c9ff367e35e
diff --git a/src/documents/index.py b/src/documents/index.py
index ea26ea926..8afc31fe9 100644
--- a/src/documents/index.py
+++ b/src/documents/index.py
@@ -602,7 +602,7 @@ def rewrite_natural_date_keywords(query_string: str) -> str:
case "this year":
start = datetime(local_now.year, 1, 1, 0, 0, 0, tzinfo=tz)
- end = datetime.combine(today, time.max, tzinfo=tz)
+ end = datetime(local_now.year, 12, 31, 23, 59, 59, tzinfo=tz)
case "previous week":
days_since_monday = local_now.weekday()