dolinsky / gmail-delay-send

Automatically exported from code.google.com/p/gmail-delay-send
0 stars 0 forks source link

Enhancement: Assume a past time is meant to be sent tomorrow #191

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Feature request:

When sending an email @8am, and it's already 9am, I would like the script to 
assume I meant '8am tomorrow', instead of '8am current day'.

So in general, as javascript:

deliver_at = new Date(timestamp_at_which_to_deliver);
now = new Date();
if (deliver_at < now) deliver_at = new Date(now.getYear(), now.getMonth(), 
now.getDay() + 1, deliver_at.getHours(), deliver_at.getMinutes(), 
deliver_at.getSeconds(), deliver_at.getMilliseconds()) ;

Original issue reported on code.google.com by timdiel...@gmail.com on 18 Feb 2015 at 7:07

GoogleCodeExporter commented 8 years ago
I forgot to mention: I appreciate you having written and shared this script, 
it's been very useful to me. Thanks.

Original comment by timdiel...@gmail.com on 18 Feb 2015 at 7:13

GoogleCodeExporter commented 8 years ago
Hello Tim,

Thanks for the suggestion and the thought that you put into the project.

The issue with adding a day would be cases like 'march'

It's currently 3/15/2015 but 'march' resolves to 'March 01 2015'.

So in this case we'd want to add 365 days to the date instead of one.

Although it's Sunday so I can't test this, I believe that if it were Monday and 
I typed 'Sunday' it would resolve to yesterday. So we'd need to add 7 days to 
the date in that case.

:-(

If I had time for a re-write I think I would get away from the entire 
date-parsing and use a calendar popup instead.

But thanks again for the thought and please let me know if you see a smart way 
to get around this.

Thanks!
-Blair

Original comment by blairk...@gmail.com on 15 Mar 2015 at 10:26