chronic
chronic copied to clipboard
Future time of day does not work
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
Does "today at 8:00" or "tomorrow at 8:00" solve your problem?
@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
.