Skip to content

Fix: Handle Taskwarrior UTC due dates and improve time comparison#1

Open
Randalix wants to merge 1 commit intoifben:masterfrom
Randalix:master
Open

Fix: Handle Taskwarrior UTC due dates and improve time comparison#1
Randalix wants to merge 1 commit intoifben:masterfrom
Randalix:master

Conversation

@Randalix
Copy link

@Randalix Randalix commented Feb 6, 2026

The due dates from taskwarrior are in UTC, but task2ntfy was comparing them against local time without converting. For you in CET (UTC+1), this shrank the time difference, and num_hours() truncation to whole hours meant tasks due within the next hour were silently dropped (rounded to 0, failing the > 0 check).

What I fixed in main.rs:

  1. Properly convert the UTC due date to local time before comparison
  2. Use num_minutes() instead of num_hours() to avoid truncation issues

The due dates from taskwarrior are in UTC, but task2ntfy was comparing them
against local time without converting. For you in CET (UTC+1), this shrank the time
difference, and num_hours() truncation to whole hours meant tasks due within the next hour
were silently dropped (rounded to 0, failing the > 0 check).

What I fixed in main.rs:
1. Properly convert the UTC due date to local time before comparison
2. Use num_minutes() instead of num_hours() to avoid truncation issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant