Internal
Public Access
Fix overdue calculation to use user's timezone
Tasks were incorrectly showing as overdue when they were due today. The issue was that the overdue check was comparing the due date against UTC's "today" instead of the user's local "today". Now uses the user's timezone setting to determine the current date when checking if a task is overdue. This ensures tasks due "today" only become overdue when the user's local date advances to tomorrow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.5
parent
c994458e24
commit
f2ca07d05d
+5
-1
@@ -218,7 +218,11 @@ class DashboardView(View):
|
||||
if not request.user.is_authenticated:
|
||||
return redirect('login')
|
||||
|
||||
today = timezone.now().date()
|
||||
# Get today's date in user's timezone
|
||||
import pytz
|
||||
user_tz = pytz.timezone(request.user.timezone)
|
||||
user_now = timezone.now().astimezone(user_tz)
|
||||
today = user_now.date()
|
||||
|
||||
# Get filter parameters
|
||||
current_filter = request.GET.get('filter', 'all')
|
||||
|
||||
Reference in New Issue
Block a user