Sha256: e791c07c3be10219ee0da95d3bb2eea583e3344dab36af8345363c0a576d0c98
Contents?: true
Size: 632 Bytes
Versions: 14
Compression:
Stored size: 632 Bytes
Contents
module Locomotive module Liquid module Filters module Date def localized_date(input, *args) format, locale = args[0], args[1] rescue 'en' date = input.is_a?(String) ? Time.parse(input) : input if format.to_s.empty? return input.to_s end date = input.is_a?(String) ? Time.parse(input) : input if date.respond_to?(:strftime) I18n.locale = locale I18n.l date, :format => format else input end end end ::Liquid::Template.register_filter(Date) end end end
Version data entries
14 entries across 14 versions & 1 rubygems