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

Projects
None yet
7 participants
@ghost
Copy link

ghost 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 some commits Apr 19, 2012

Added tests to verify that {{ 'now' | date :'%Y' }} and {{ 'today' | …
…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.
Merge branch 'master' of git://github.com/Shopify/liquid
* '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

This comment has been minimized.

Copy link

dekellum commented Jun 30, 2012

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

@CraigCottingham

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

aprescott commented Nov 29, 2012

Is there any update with this?

@fw42

This comment has been minimized.

Copy link
Member

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)

This comment has been minimized.

Copy link
@fw42

fw42 Jun 5, 2013

Member

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

@boourns

This comment has been minimized.

Copy link

boourns commented Jun 5, 2013

:shipit:

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

This comment has been minimized.

Copy link
@fw42

fw42 Jun 5, 2013

Member

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

@fw42

This comment has been minimized.

Copy link
Member

fw42 commented Jun 5, 2013

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

@fw42

This comment has been minimized.

Copy link
Member

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
You can’t perform that action at this time.