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
 89 def call(tag)
 90   case tag
 91   when Tag
 92     if tag.type.to_s == 'input' && %w'date datetime datetime-local'.include?((tag.attr[:type] || tag.attr['type']).to_s)
 93       attr = tag.attr.dup
 94       attr.delete(:type)
 95       attr.delete('type')
 96       attr['type'] = 'text'
 97       "<#{tag.type}#{attr_html(attr)}/>"
 98     else
 99       super
100     end
101   else
102     super
103   end
104 end