Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To do items #tagged with tomorrow's date appear in the "Today" tab #21

Closed
ryadaj opened this issue Apr 18, 2021 · 2 comments
Closed

To do items #tagged with tomorrow's date appear in the "Today" tab #21

ryadaj opened this issue Apr 18, 2021 · 2 comments
Milestone

Comments

@ryadaj
Copy link

ryadaj commented Apr 18, 2021

To do items #tagged with tomorrow's date appear in the "Today" tab. I like that past unfinished items appear in the today tab, but I don't like that tomorrow's items also appear there. Is this possible to change? In the attached screenshot, you will see two items tagged with 2021-04-19 but today is 2021-04-18.

Thank you very much! I love this plugin :)

Screen Shot 2021-04-18 at 10 04 54 AM

@michaelpporter
Copy link

I did some debugging, not sure how to fix it but here is the issue

The TODO date gets set to a JavaScript date which sets the time to 0's stackoverflow.com

Somewhere this date gets converted from GMT to the local time, for me that is Central Time in the US.

Starting with #2021-05-16 this gets set to Sat May 15 2021 19:00:00 GMT-0500 (Central Daylight Time) in obsidian. The isToday function compares the Year Month Date values but the date is never set back to GMT.

[obsidian-plugin-todo] - istoday true - date Sat May 15 2021 19:00:00 GMT-0500 (Central Daylight Time) - today Sat May 15 2021 00:00:00 GMT-0500 (Central Daylight Time)
        const actionDate = dateMatches != null ? new Date((_a = dateMatches[0]) === null || _a === void 0 ? void 0 : _a.substring(1)) : undefined;
        const isToday = (date) => {
            const today = new Date();
            return (date.getDate() == today.getDate() &&
                date.getMonth() == today.getMonth() &&
                date.getFullYear() == today.getFullYear());
        };

michaelpporter added a commit to michaelpporter/obsidian-plugin-todo that referenced this issue May 16, 2021
- converted isToday to use UTC for TODO date
- isBeforeToday to use UTC for today.
- May not work east of UTC.
@larslockefeer
Copy link
Owner

Hi @ryadaj, thanks for reporting. This should be fixed by the changes I introduced as part of #35.

By installing this plugin directly from source, you should be able to use this. I'm waiting for some others to test-drive this to be sure that it works for everyone and not just for me. Once I get some confirmation, I'll cut a new release that includes the fix, such that all users can upgrade from within Obsidian.

@larslockefeer larslockefeer added this to the 0.2.0 milestone Nov 11, 2021
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

No branches or pull requests

3 participants