fix natural day calculation #1100

This commit is contained in:
FuzzyGrim
2026-02-02 00:08:47 +01:00
parent c43d712663
commit 974d711df3

View File

@@ -231,11 +231,10 @@ def status_color(status):
@register.filter
def natural_day(datetime, user):
"""Format date with natural language (Today, Tomorrow, etc.)."""
# Get today's date in the current timezone
today = timezone.localdate()
# Extract just the date part for comparison
datetime_date = datetime.date()
local_dt = timezone.localtime(datetime)
datetime_date = local_dt.date()
# Calculate the difference in days
diff = datetime_date - today