mirror of
https://github.com/FuzzyGrim/Yamtrack.git
synced 2026-03-03 03:47:02 +00:00
fix natural day calculation #1100
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user