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

Timezone issue? #69

Open
HackMasterFlash opened this issue Mar 20, 2020 · 11 comments
Open

Timezone issue? #69

HackMasterFlash opened this issue Mar 20, 2020 · 11 comments

Comments

@HackMasterFlash
Copy link

My raspberry pi has the timezone set for New York and displays time correctly. I have my ToDoist account in the same time zone. But the MM module is showing list items with the incorrect due date. Example an item due on 3/20 (today) is saying it was due yesterday. Is this a UTC issue?

@gonzonia
Copy link

I'm having the same issue.

@cbrooker
Copy link
Owner

I'll try to get this resolved today. I think MM changed the way they handle time zones.

@gonzonia
Copy link

I'm actually trying to figure it out now. The problem happens when you convert
item.due.date returns 2020-03-23
but
dueDateTime returns Sun Mar 22 2020 20:00:00 GMT-0400 (EDT)

dueDateTime is the result of
var dueDateTime = new Date(item.due.date);

@xozai
Copy link

xozai commented May 10, 2020

I am having the same issue.

@bonochromatic
Copy link

I'll chime in - I'm seeing the same issue. I'm expecting to see today's tasks (and my overdue's), but instead I'm seeing today's and tomorrow's, with today's showing as "yesterday" and tomorrow's showing as "today." Aligns with what gonzonia mentioned up above. Did any of you manage to figure it out yet?

Or...am I seeing a new occurrence of an already-solved issue?

@gonzonia
Copy link

No, it's still going on. I go in and add a + 1 to the diffDays calculation everytime there's a new update to the module. It's a minor tweak and not worth forking for. I'm not sure why it's even happening.

@smartbrain83
Copy link

I am also experiencing this issue. When a add a task for today it shows up in MM as being due yesterday.

@gonzonia -- where at exactly did you add "+1" to diffDays? Was it under the "if (self.config.displayTasksWithinDays..." statement or under the "autoDueDateCell" function?

@gonzonia
Copy link

In MMM-Todoist.js I changes line 457 to
var diffDays = Math.floor((dueDate - today + 7200000) / (oneDay))+1;

@diego-escalante
Copy link
Contributor

I have an open pull request that will fix this, I believe. The issue is that tasks with only a due day are relative to UTC time, whereas tasks with a due day and time are (correctly) interpreted relative to your local timezone.

@deyawper
Copy link

This resolved the floating timezone issue but if the timezone is chosen in Todoist (i.e. not the floating default), due times are now off.

@diego-escalante
Copy link
Contributor

@deyawper, you are right. I forgot to take into account set timezones. Looks like Todoist returns due dates with timezones set as UTC in zulu format. I made another pull request to take this into account.

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

8 participants