Sha256: 81792219b7880ef608e370e8050e0bdd5e5eb6f844d0b604924a3ad856e01ac7
Contents?: true
Size: 556 Bytes
Versions: 10
Compression:
Stored size: 556 Bytes
Contents
module CommonCoreJs module ControllerHelper def modify_date_inputs_on_params(modified_params) use_timezone = current_account.timezone || Time.now.strftime("%z") modified_params = modified_params.tap do |params| params.keys.each{|k| if k.ends_with?("_at") || k.ends_with?("_date") begin params[k] = DateTime.strptime("#{params[k]} #{use_timezone}", '%Y-%m-%dT%H:%M %z') rescue StandardError end end } end modified_params end end end
Version data entries
10 entries across 10 versions & 1 rubygems