Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'today' parameter to .parse method #304

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

novikserg
Copy link

Refs #295
This one allows Chronic.parse method to receive today: true param alongside a string to parse to allow parsing ambiguous week days by name. For example:

Time.now                             #=> Sun Aug 27 23:18:25 PDT 2006
Chronic.parse('sunday')              #=> Sun Sep 03 12:00:00 PDT 2006
Chronic.parse('sunday', today: true) #=> Sun Aug 27 12:00:00 PDT 2006

Somewhat a quick workaround for now since new version is going to change it all anyway.

Refs mojombo#295
This one allows Chronic.parse method to receive
`today: true` param alongside a string to parse to allow
parsing ambiguous week days by name. E.g.:

Time.now  			     #=> Sun Aug 27 23:18:25 PDT 2006
Chronic.parse('sunday') 	     #=> Sun Sep 03 12:00:00 PDT 2006
Chronic.parse('sunday', today: true) #=> Sun Aug 27 12:00:00 PDT 2006
@novikserg novikserg force-pushed the parse_today_by_day_name_optionally branch from 49a52e2 to 5befd51 Compare May 15, 2015 06:12
@davispuh
Copy link
Collaborator

yeah I think this can be used, what do you @leejarvis think? also might as well merge beta branch in master and release it as there are some fixes and it's been sitting there for ages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants