Module: Condensation::Filters::Timestamp
- Defined in:
- lib/condensation/filters/timestamp.rb
Instance Method Summary collapse
Instance Method Details
#timestamp(input) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/condensation/filters/timestamp.rb', line 4 def (input) return if input.respond_to?(:empty?) ? input.empty? : !input value = input unless value.is_a?(Time) begin value = Time.parse(input) rescue raise Liquid::ArgumentError, "cannot convert #{input} to timestamp" end end value.to_i end |