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 34 forks source link

All ambiguous date entries assume a future date #9

Closed thapar closed 9 years ago

thapar commented 9 years ago

Since it doesn't make sense to assume a past date/time to send an email message, all ambiguous entries such as "7am" (when it is currently "9am") will assume "7am tomorrow".

Solves https://github.com/webdigi/GmailScheduler/issues/7 and possibly the confusion behind https://github.com/webdigi/GmailScheduler/issues/3

thapar commented 9 years ago

What seems to be the issue in merging this?

thapar commented 9 years ago

@webdigi It's nearly 3 weeks since this pull request. This change should resolve https://github.com/webdigi/GmailScheduler/issues/7 and https://github.com/webdigi/GmailScheduler/issues/3. Some discussion on your thoughts would be apt and appreciated.

webdigi commented 9 years ago

Thanks for your active participation.

We could not test this fully. How did you test this update? EG: 9AM today (when it is 7am) today 9AM today (when it is 10am) today tomorrow at 7am (when it is 9am) today or what happens if user typed in an incorrect entry like tommo 8am

The change looks minor but it could cause other issues if not tested. Let us know how we can test this before we deploy to all users.

thapar commented 9 years ago

Thanks for the response. To answer your question, everything works as expected. This change only affects ambiguous date/time entries by choosing a future date (which makes sense, of course, because no one can send an email in the past).

9AM today (when it is 7am) -> Mon Feb 16 2015 09:00:00 GMT-0500 (Eastern Standard Time)
9AM today (when it is 10am) -> Mon Feb 16 2015 09:00:00 GMT-0500 (Eastern Standard Time)
tomorrow at 7am (when it is 9am) -> Tue Feb 17 2015 07:00:00 GMT-0500 (Eastern Standard Time)
tommo 8am -> Invalid Date

These are all the date/times that would be expected. Also note that "9am today (when it is 10am)" creates a date in the past. This is because there is no issue for a user to create a date in the past if they want to. The only situation this pull request will take affect is if there is an ambiguous date/time provided. In such cases, a future date will be suggested. For example:

9am (when it is 10am) -> Tue Feb 17 2015 09:00:00 GMT-0500 (Eastern Standard Time)

Since "9am" is in the past, and the user didn't say "today" or "tomorrow" or any other date-specifying modifier, it'll choose the next upcoming 9am. This, of course, makes complete sense for GmailScheduler.