webdigi / GmailScheduler

Google app script system to allow gmail / google business apps users to schedule outgoing messages & to set messages to return to inbox
Other
102 stars 36 forks source link

Issue with dates and times #3

Open KurtRussellCM3 opened 9 years ago

KurtRussellCM3 commented 9 years ago

It is 10:30 pm Central Time (Chicago, Mexico City). If I create a label that says "5:00 am today," it makes a correct label that states "The label 5:00 am today would trigger the email on Sunday September 14, 2014 5:00:00am." If I create a label that says "4:00 am today," it comes back with this message: "Invalid date to "Date in the past / Cannot find date from label name."" The problem continues with times earlier than 4:00 am, such as 3:00 am or 2:00 am. There is no problem for times after 5:00 am such as 6:00 am or 7:00 am. Is there a problem with the date being separate from the GMT? GMT is 6 hours different from Central Time. The error seems to happen six hours in the future. Also, if I put 4:00 am tomorrow, it creates a label too far into the future, Monday September 14. Thank you.

webdigi commented 9 years ago

Thanks for the report. If you go into the settings page is the correct timezone selected?

KurtRussellCM3 commented 9 years ago

Sorry for the late reply. Yes, I have the correct timezone selected. Besides, if the change from "today" and "tomorrow" in the labels is midnight, the labels I set for say "7:00 am today" should have an error message, because that is in the past. I use "today" because it sends the email when I want it to send (eight and a half hours in the future), but technically I should be making the label as "7:00 am tomorrow." The error of being in the past only comes up within six hours because GMT is six hours ahead of my time, making my date switch at 2400 GMT, not at 2400 CST, at least that's my guess. I think it is coded so that the time is CST but the date is GMT. But anyway, Gmail Scheduler is very helpful to me. Thank you for making it/servicing it. Sorry to whine about it.

webdigi commented 9 years ago

Thanks for more details on the report.

Yes, it should not allow you to set labels that generate dates in the past.

Can you please 1) Attach a screenshot of the page where it says "7 am today"? 2) Attach a screenshot of 1 second later 3) Attach a screenshot of 1 day later 4) Attach a screenshot of next sunday at 7am In all screenshots it will be useful if you can grab the screenshot with the computer clock / current time on your selected timezone.

KurtRussellCM3 commented 9 years ago

7:00 am today 7am

KurtRussellCM3 commented 9 years ago

1 second later 1sec

KurtRussellCM3 commented 9 years ago

1 day later 1day

KurtRussellCM3 commented 9 years ago

next Sunday at 7:00 am nextsunday

KurtRussellCM3 commented 9 years ago

And just to show that I can't get it to send at 4:00 am, five-ish hours from now here is 4:00 am today and 4:00 am tomorrow, respectively. 4today 4tomorrow

KurtRussellCM3 commented 9 years ago

Thanks again for the help. Sorry to bother you.

thapar commented 9 years ago

@KurtRussellCM3 Why would you expect "4am today" to create a label for tomorrow's date of 4am?

webdigi commented 9 years ago

@KurtRussellCM3 - Please check and we can close once @thapar confirms.

KurtRussellCM3 commented 9 years ago

I explained very thoroughly. Please reread my posts, and you should be able to understand the problem.

On Tue, Feb 24, 2015 at 10:30 AM, Webdigi - Web Development < notifications@github.com> wrote:

@KurtRussellCM3 https://github.com/KurtRussellCM3 - Please check and we can close once @thapar https://github.com/thapar confirms.

— Reply to this email directly or view it on GitHub https://github.com/webdigi/GmailScheduler/issues/3#issuecomment-75790215 .

thapar commented 9 years ago

@KurtRussellCM3, there is a bug in a native function of Google App Scripts itself: https://code.google.com/p/google-apps-script-issues/issues/detail?id=2845

Meaning, GmailScheduler needs to manually calculate the timezone offset from the UTC and then do some math before showing the user a time. It should work properly after such an approach is implemented.