Sha256: ea179f2b9467d1a89c7d7117abc1de60beb322c83b10afe0718c69e5f0674490
Contents?: true
Size: 693 Bytes
Versions: 12
Compression:
Stored size: 693 Bytes
Contents
require "common_core_js/engine" require 'kaminari' require 'haml-rails' module CommonCoreJs # Your code goes here... # module ControllerHelpers def modify_date_inputs_on_params(modified_params, authenticated_user = nil) use_timezone = authenticated_user.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
12 entries across 12 versions & 1 rubygems