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

Parse weekday names. #8

Merged
merged 1 commit into from
Nov 24, 2014
Merged

Parse weekday names. #8

merged 1 commit into from
Nov 24, 2014

Conversation

calleluks
Copy link
Owner

Names of weekdays are parsed to the next occurrence of that weekday relative
to the current date. Weekday names can optionally be prepended with the word
"next".

Closes #3.

@@ -14,7 +14,7 @@ class InternalParser < Parslet::Parser
end

rule :date do
(tomorrow | numerical_date | date_with_month_name).as(:date_factory)
(tomorrow | weekday | numerical_date | date_with_month_name).as(:date_factory)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [84/80]

specify { expect(time("sunday")).to eq Time.new(2014, 11, 16, 12, 0, 0, 0) }
specify { expect(time("Sunday")).to eq Time.new(2014, 11, 16, 12, 0, 0, 0) }
specify { expect(time("sun")).to eq Time.new(2014, 11, 16, 12, 0, 0, 0) }
specify { expect(time("Sun")).to eq Time.new(2014, 11, 16, 12, 0, 0, 0) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [81/80]

Names of weekdays are parsed to the next occurrence of that weekday relative
to the current date. Weekday names can optionally be prepended with the word
"next".

Closes #3.
@calleluks calleluks merged commit 5d9dbf5 into master Nov 24, 2014
@calleluks calleluks deleted the ce-weekdays branch November 24, 2014 23:40
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.

Parse weekday names.
2 participants