Sha256: 9d469a1e42a4a1b546dbca3b5c500b2c341523ec31b0f30956240296730f9957
Contents?: true
Size: 745 Bytes
Versions: 47
Compression:
Stored size: 745 Bytes
Contents
module ActionView module Helpers module Tags # :nodoc: class DatetimeField < TextField # :nodoc: def render options = @options.stringify_keys options["value"] ||= format_date(value(object)) options["min"] = format_date(datetime_value(options["min"])) options["max"] = format_date(datetime_value(options["max"])) @options = options super end private def format_date(value) raise NotImplementedError end def datetime_value(value) if value.is_a? String DateTime.parse(value) rescue nil else value end end end end end end
Version data entries
47 entries across 47 versions & 4 rubygems