Sha256: 438ac3dd06dbd9940739c0a148d1176751e7ea9753a44129646ad4015f2d1b04
Contents?: true
Size: 554 Bytes
Versions: 37
Compression:
Stored size: 554 Bytes
Contents
# frozen_string_literal: true module ActionView module Helpers module Tags # :nodoc: class TimeField < DatetimeField # :nodoc: def initialize(object_name, method_name, template_object, options = {}) @include_seconds = options.delete(:include_seconds) { true } super end private def format_date(value) if @include_seconds value&.strftime("%T.%L") else value&.strftime("%H:%M") end end end end end end
Version data entries
37 entries across 35 versions & 4 rubygems