Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Change name of filter to something more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
osahyoun committed Mar 24, 2016
1 parent 1ee345d commit 84e4770
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/liquid/liquid_i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def t(query)
end
end

def date_for_link(date)
I18n.l( Time.parse(date) )
def i18n_date(date, format = :default)
I18n.l( Time.parse(date), format: format.to_sym )
end

def val(base, key, value)
Expand Down
2 changes: 1 addition & 1 deletion app/liquid/views/partials/_links.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{ link.source }}.
{% endunless %}
{% unless link.date == blank %}
{{ link.date | date_for_link }}.
{{ link.date | i18n_date }}.
{% endunless %}
</div>
{% endfor %}
Expand Down
4 changes: 2 additions & 2 deletions spec/liquid/liquid_i18n_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
end


describe '#date_for_link', :focus do
describe '#date_for_link' do
{
en: "1 December, 2016",
fr: "1 décembre, 2016",
Expand All @@ -117,7 +117,7 @@
I18n.locale = locale

expect(
subject.date_for_link('2016-12-01')
subject.i18n_date('2016-12-01')
).to eq(translation)
end
end
Expand Down

0 comments on commit 84e4770

Please sign in to comment.