Sha256: f3596ff07d04c537ddfede4ab799abd0f7ffeb9784d60e8b49af6b05a67c578e
Contents?: true
Size: 450 Bytes
Versions: 39
Compression:
Stored size: 450 Bytes
Contents
# frozen_string_literal: true module Alchemy module Ingredients # A datetime value # class Datetime < Alchemy::Ingredient 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.essence_date') end end end end
Version data entries
39 entries across 39 versions & 1 rubygems