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

Updated {{ 'now' | date :'%Y' }} to work with Ruby 1.9.3 #117

Merged
merged 2 commits into from Jun 18, 2013

Conversation

@ndwebgroup
Copy link

@ndwebgroup ndwebgroup commented Apr 19, 2012

...e :'%Y' }} work.

In the case of Ruby 1.9.3, 'now' is no longer parsed. For safe
measures, I've added 'today' as well.

jeremyf added 2 commits Apr 19, 2012
…date :'%Y' }} work.

In the case of Ruby 1.9.3, 'now' is no longer parsed.  For safe
measures, I've added 'today' as well.
* 'master' of git://github.com/Shopify/liquid:
  * Seperated 'Howto' into 'How to'. * Added periods to the second list as the first item has them. I guess I'm anally retentive like that. :)
  Fix conditions using negative number comparisons
@dekellum
Copy link

@dekellum dekellum commented Jun 30, 2012

I just was bitten by this as well. Any update? Ruby 1.9.3 or Liquid bug?

@CraigCottingham
Copy link

@CraigCottingham CraigCottingham commented Sep 12, 2012

I just ran into this as well. Since there doesn't seem to be any progress with accepting this pull request, I worked around it by using {{ site.time | date: '%y' }}. Note that I'm using Jekyll, so maybe this won't work outside of that.

@aprescott
Copy link

@aprescott aprescott commented Nov 29, 2012

Is there any update with this?

@fw42
Copy link
Contributor

@fw42 fw42 commented Jun 5, 2013

Seems to be a Ruby 1.9.3 regression. Looks good to me. No apparent performance impact. @boourns?

@@ -169,7 +169,16 @@ def date(input, format)
input = Time.at(input.to_i)
end

date = input.is_a?(String) ? Time.parse(input) : input
date =
if input.is_a?(String)
Copy link
Contributor

@fw42 fw42 Jun 5, 2013

This indentation is weird. Can we fix that? (move the if up into the date = ... line)

@boourns
Copy link

@boourns boourns commented Jun 5, 2013

:shipit:

date =
if input.is_a?(String)
case input.downcase
when 'now', 'today' then Time.now
Copy link
Contributor

@fw42 fw42 Jun 5, 2013

Nitpicking, can we move the Time.now into the next line and drop the then?

@fw42
Copy link
Contributor

@fw42 fw42 commented Jun 5, 2013

@ndwebgroup, if you could fix my two little comments, I will merge this. Thanks for contributing!

@fw42
Copy link
Contributor

@fw42 fw42 commented Jun 18, 2013

Merged in 8ca4868

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

Successfully merging this pull request may close these issues.

None yet

7 participants