Sha256: 58dfb14c77b3e93868f6997dbddd919111e127688ac7770dabb8573c96651786
Contents?: true
Size: 685 Bytes
Versions: 17
Compression:
Stored size: 685 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
17 entries across 17 versions & 1 rubygems