Sha256: b1ea8863db36ec22ccd6c5045a8f7d919f5aaac6e72ae4fda9e64bcd172cb394

Contents?: true

Size: 929 Bytes

Versions: 15

Compression:

Stored size: 929 Bytes

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
class DatetimePairInput < DatePairInput
  private

  # Tell datepicker this is a datetime
  #------------------------------------------------------------------------------
  def input_html_classes
    classes = super.dup
    classes.delete('date')
    classes.push('datetime')
  end

  # Return value recognised by datepicker and ensure timezone properly set by AR
  #------------------------------------------------------------------------------
  def value(field)
    val = object.send(field.name)
    val.present? ? val.strftime('%Y-%m-%d %H:%M') : nil
  end

  ActiveSupport.run_load_hooks(:fat_free_crm_datetime_pair_input, self)
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 app/inputs/datetime_pair_input.rb
fat_free_crm-0.15.2 app/inputs/datetime_pair_input.rb
fat_free_crm-0.16.4 app/inputs/datetime_pair_input.rb
fat_free_crm-0.14.1 app/inputs/datetime_pair_input.rb
fat_free_crm-0.15.1 app/inputs/datetime_pair_input.rb
fat_free_crm-0.16.3 app/inputs/datetime_pair_input.rb
fat_free_crm-0.16.2 app/inputs/datetime_pair_input.rb
fat_free_crm-0.16.1 app/inputs/datetime_pair_input.rb
fat_free_crm-0.16.0 app/inputs/datetime_pair_input.rb
fat_free_crm-0.15.0 app/inputs/datetime_pair_input.rb
fat_free_crm-0.15.0.beta.2 app/inputs/datetime_pair_input.rb
fat_free_crm-0.15.0.beta app/inputs/datetime_pair_input.rb
fat_free_crm-0.14.0 app/inputs/datetime_pair_input.rb
reduced_fat_crm-0.15.0.beta app/inputs/datetime_pair_input.rb
reduced_fat_crm-0.14.0 app/inputs/datetime_pair_input.rb