class Forme::Serializer::AmericanTime

  1. lib/forme/transformers/serializer.rb
Superclass: Serializer

Overrides formatting of dates and times to use an American format without timezones.

Methods

Public Instance

  1. call

Public Instance methods

call(tag)
[show source]
    # File lib/forme/transformers/serializer.rb
 95 def call(tag)
 96   case tag
 97   when Tag
 98     if tag.type.to_s == 'input' && %w'date datetime datetime-local'.include?((tag.attr[:type] || tag.attr['type']).to_s)
 99       attr = tag.attr.dup
100       attr.delete(:type)
101       attr.delete('type')
102       attr['type'] = 'text'
103       "<#{tag.type}#{attr_html(attr)}>"
104     else
105       super
106     end
107   else
108     super
109   end
110 end