Sha256: 37ae9d5a15450f25c224275fe3cd93a6020a3961e6940c31f5ed6bfef00c7bca
Contents?: true
Size: 334 Bytes
Versions: 61
Compression:
Stored size: 334 Bytes
Contents
# frozen_string_literal: true module Decidim module Attributes # Custom Virtus value to parse a String representing a Time using # the app TimeZone. class TimeWithZone < Virtus::Attribute def coerce(value) return value unless value.is_a?(String) Time.zone.parse(value) end end end end
Version data entries
61 entries across 61 versions & 2 rubygems
Version | Path |
---|---|
decidim-core-0.2.0 | lib/decidim/attributes/time_with_zone.rb |