Sha256: 64a2c721350ccf5f656f424757c2a09b44f87d52e372b07370a4498c7da209e7
Contents?: true
Size: 502 Bytes
Versions: 10
Compression:
Stored size: 502 Bytes
Contents
# frozen_string_literal: true module Alchemy module Ingredients # A datetime value # class Datetime < Alchemy::Ingredient allow_settings %i[date_format input_type] def value ActiveRecord::Type::DateTime.new.cast(self[:value]) end # Returns localized date for the Element#preview_text method. def preview_text(_maxlength = nil) return "" unless value ::I18n.l(value, format: :"alchemy.ingredient_date") end end end end
Version data entries
10 entries across 10 versions & 1 rubygems