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

last failing on first of the month #300

Open
veesahni opened this issue Apr 1, 2015 · 0 comments
Open

last failing on first of the month #300

veesahni opened this issue Apr 1, 2015 · 0 comments
Labels

Comments

@veesahni
Copy link

veesahni commented Apr 1, 2015

This works:

Chronic.parse("last 11:00", :now => Time.parse("2015-04-02 14:01:19 UTC"))
=> 2015-04-01 11:00:00 +0000

This doesn't:

Chronic.parse("last 11:00", :now => Time.parse("2015-04-01 14:01:19 UTC"))
ArgumentError: argument out of range
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic.rb:146:in `initialize'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic.rb:146:in `new'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic.rb:146:in `construct'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic/repeaters/repeater_day_portion.rb:50:in `next'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic/handlers.rb:521:in `get_anchor'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic/handlers.rb:414:in `handle_r'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic/handler.rb:76:in `invoke'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic/parser.rb:247:in `block in tokens_to_span'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic/parser.rb:244:in `each'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic/parser.rb:244:in `tokens_to_span'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic/parser.rb:61:in `parse'
        from /home/x/.rvm/gems/ruby-2.1.2/gems/chronic-0.10.2/lib/chronic.rb:90:in `parse'

The difference between the two is the date.

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

No branches or pull requests

2 participants