Fix timezone handling in date-based task filterin#41
Open
uncazzy wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Date-based task filtering functions (
get_tasks_due_today,get_overdue_tasks, etc.) compare task due dates against UTC midnight boundaries. This causes tasks scheduled later in the day to be excluded from "due today" results if their UTC timestamp falls on a different calendar day.Example: A task scheduled for 6:00 PM Eastern on December 2nd is stored as
2025-12-03T00:30:00Zin UTC. When checking "tasks due today" on December 2nd, the function would exclude this task because its UTC date is December 3rd.Solution
timezoneparameter to all date-based functions (defaults toAmerica/New_York)tzdatadependency for cross-platform timezone support (required on Windows)Affected Functions
get_tasks_due_today()get_tasks_due_tomorrow()get_tasks_due_in_days()get_overdue_tasks()get_tasks_due_this_week()get_engaged_tasks()get_next_tasks()Usage
Works out of the box with Eastern Time default:
Or specify a different timezone: