chronic
                                
                                 chronic copied to clipboard
                                
                                    chronic copied to clipboard
                            
                            
                            
                        Parse `monday` returns next monday
Today is monday (9. feb. 2015, ~12:20). When parsing monday parser returns next monday instead.
Chronic.parse('monday') 
#2015-02-16 12:00:00 +0100
Chronic.parse('this monday') 
#2015-02-16 12:00:00 +0100
Chronic.parse('monday at 16:30')
#2015-02-16 16:30:00 +0100
that's kinda expected, because by default :context => :future, but current version is still bugged... currently you can use some hacks like subtracting day or using  :context => :past for this case...
in next, yet unreleased version (my rewrite branch) it will be
Chronic.parse('monday', :context => nil)
# 2015-02-09 12:00:00 +0200
Chronic.parse('this monday', :context => nil)  # this is debatable if it should be today...
# 2015-02-16 12:00:00 +0200
Chronic.parse('monday at 16:30', :context => nil)
# 2015-02-09 16:30:30 +0200
@davispuh Thanks for your answer. context: nil sound good. In my current project I need to execute an action e.g. every Monday. It would be great if context: nil will find the closest Monday - if today is Monday it will return today's Time if today is Tuesday it will return next week's Monday. What do you think?
it's not really implemented so... context: nil would return Monday in that week so for Tuesday it would be like last Monday, for your case seems you need context: :future but just some flag so that current day is returned if it's Monday which is only exception
Yes, a flag would do the trick.
Just noting that I would be interested in this flag functionality as well!
Any news on this? It has been over a year?