Skip to content

Add date filtering for Todoist project syncs - #724

Open
felciano wants to merge 11 commits into
NotePlan:mainfrom
felciano:feature/todoist-date-filter
Open

Add date filtering for Todoist project syncs#724
felciano wants to merge 11 commits into
NotePlan:mainfrom
felciano:feature/todoist-date-filter

Conversation

@felciano

@felcianofelciano commented Jan 19, 2026

Copy link
Copy Markdown

Date Filtering for Todoist Project Syncs

This branch adds the ability to filter which Todoist tasks are synced based on their due dates.

New Commands

CommandAliasDescription
/todoist sync project todaytosptSync only tasks due today
/todoist sync project overduetospoSync only overdue tasks
/todoist sync project currenttospcSync overdue + today's tasks

The existing /todoist sync project command now respects the date filter setting.

New Settings

  • Date filter for project syncs - Choose which tasks to sync: all, today, overdue | today, 3 days, or 7 days

Per-Note Filtering

You can override the global setting for individual notes using frontmatter:

---
todoist_id: 12345todoist_filter: today
---

Valid filter values: all, today, overdue, current (overdue + today), 3 days, 7 days

felcianoand others added 9 commits January 18, 2026 20:45
- Add projectDateFilter setting with choices: all, today, overdue|today, 7 days
- Default to 'overdue | today' to focus on actionable tasks
- Fix URL encoding in filter construction
- Update README with documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Support /todoist sync project today
- Support /todoist sync project overdue
- Support /todoist sync project current (today+overdue)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- /todoist sync project today (alias: tospt)
- /todoist sync project overdue (alias: tospo)
- /todoist sync project current (alias: tospc)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ensureHeadingExists helper function
- Create section headings from Todoist automatically
- Create default header from settings automatically
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use for...of instead of forEach for proper async/await
- Add filterTasksByDate() for client-side filtering
- Todoist API ignores filter param when project_id is specified
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace ensureHeadingExists with addTaskBelowHeading
- When heading doesn't exist, append both heading and task
- Use appendTodo after creating heading instead of addTodoBelowHeadingTitle
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add isEditorNote flag throughout the call chain
- Use Editor.appendParagraph instead of note methods for current note
- Fixes tasks not appearing when syncing the open note
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Read todoist_filter from note frontmatter
- Priority: command-line > frontmatter > settings
- Valid values: all, today, overdue, current, 7 days
- Updated README with documentation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@felciano

felciano commented Jan 20, 2026

Copy link
Copy Markdown
Author

@dbludeau this is my first PR for Noteplan and I'm not sure I fully understand the process. Please let me know if you need more from me

@dbludeau

Copy link
Copy Markdown
Contributor

@felciano wow. This is excellent stuff. Are you on the NotePlan discord? If so, can you drop me a DM (@drb). There has been some changes since I last pushed, so might need to get some of the other devs or Eduard's help.

@dbludeau

Copy link
Copy Markdown
Contributor

@felciano 2 issues cropping up in early testing.

  • If a heading does not exist, it seems to be creating it for each task it adds. If the heading does exist, then it properly puts all tasks under that one heading.

  • It is not doing dates correctly in my timezone (Mountain Standard Time). I chose today and overdue for sync project, it is returning 3 tasks from today and one from tomorrow (should not be there). When I change it only to "today", it is returning only the one task for tomorrow. So it is using GMT or something to decide the date. I am not sure if there are built in NotePlan functions that may help solve that.

@felciano

Copy link
Copy Markdown
Author

Thanks @dbludeau I will review both of these this week

felcianoand others added 2 commits January 25, 2026 22:09
Reverts heading-related commits that were incorrectly added to this branch:
- Auto-create headings if they don't exist
- Fix heading creation
- Use Editor methods for the currently open note
These features belong in feature/todoist-multi-project branch.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When parsing Todoist due dates, new Date('YYYY-MM-DD') interprets the
date as UTC midnight, causing incorrect filtering for users in non-UTC
timezones (e.g., Mountain Standard Time).
Added parseLocalDate() helper that splits the ISO date string and creates
a Date using local timezone (new Date(year, month, day)).
Fixes issue where 'today' filter was returning tomorrow's tasks.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@felciano

Copy link
Copy Markdown
Author

@dbludeau both are fixed. The heading issue was a mistake--this code should be part of a separate feature enhancement (multiple projects per note), so I moved that code to a different branch.

The timezone glitch was definitely a bug; should. be fixed now

@felciano

Copy link
Copy Markdown
Author

I also put a description of this feature into the first comment of the PR

Sign up for freeto 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.

2 participants

@felciano@dbludeau