Sha256: f38e64d3c35dd753293f56c0f079c2bd63987c4224e5734e3c7ae2fce07e0d39
Contents?: true
Size: 1015 Bytes
Versions: 18
Compression:
Stored size: 1015 Bytes
Contents
require_relative 'date_field' module Avo module Fields class DatetimeField < DateField def initialize(name, **args, &block) @defaults = { sortable: true, component: 'datetime-field', } super(name, **args, &block) @picker_format = args[:picker_format].present? ? args[:picker_format] : 'Y-m-d H:i:S' @format = args[:format].present? ? args[:format] : 'YYYY-MM-DD hh:mm:ss A' @time_24hr = args[:time_24hr].present? ? args[:time_24hr] : false @timezone = args[:timezone].present? ? args[:timezone] : Rails.application.config.time_zone end def hydrate_field(fields, model, resource, view) { first_day_of_week: @first_day_of_week, picker_format: @picker_format, format: @format, placeholder: @placeholder, enable_time: true, time_24hr: @time_24hr, timezone: @timezone, relative: @relative, } end end end end
Version data entries
18 entries across 18 versions & 1 rubygems