chronic icon indicating copy to clipboard operation
chronic copied to clipboard

Future time of day does not work

Open andrewhavens opened this issue 9 years ago • 2 comments

I expect the returned date to be tomorrow, not today.

> Time.now
=> 2016-01-08 12:35:06 -0800
> Chronic.parse "8am", context: :future
=> 2016-01-08 08:00:00 -0800

I could use "next"...

> Time.now
=> 2016-01-08 12:35:06 -0800
> Chronic.parse "Next 8am", context: :future
=> 2016-01-09 08:00:00 -0800

However, that does not work when you expect to return the current day:

> Time.now
=> 2016-01-08 12:35:06 -0800
> Chronic.parse "Next 2pm", context: :future
=> 2016-01-09 14:00:00 -0800

andrewhavens avatar Jan 08 '16 20:01 andrewhavens

Does "today at 8:00" or "tomorrow at 8:00" solve your problem?

nikkypx avatar Jul 06 '16 19:07 nikkypx

@nikkypx No, the problem is that I'm asking Chronic to determine this by using the context: :future option. Chronic does not seem to be respecting this option. I just tried this again today using Chronic 0.10.2.

andrewhavens avatar Jul 06 '16 21:07 andrewhavens