Sha256: fcefbce01c30acb2355af1f87f0e70a5db672249582504aa31a362ca06381a4f
Contents?: true
Size: 534 Bytes
Versions: 47
Compression:
Stored size: 534 Bytes
Contents
module Fields::DateAndTimeSupport extend ActiveSupport::Concern def assign_date_and_time(strong_params, attribute) attribute = attribute.to_s time_zone_attribute = "#{attribute}_time_zone" if strong_params.dig(attribute).present? time_zone = ActiveSupport::TimeZone.new(strong_params[time_zone_attribute] || current_team.time_zone) strong_params.delete(time_zone_attribute) strong_params[attribute] = time_zone.strptime(strong_params[attribute], t("global.formats.date_and_time")) end end end
Version data entries
47 entries across 47 versions & 1 rubygems