Sha256: 6af3b2211b1b5a0e403cb19a6f9b6e372c3ec7686120fcf995f2e3afea06df98
Contents?: true
Size: 960 Bytes
Versions: 13
Compression:
Stored size: 960 Bytes
Contents
# frozen_string_literal: true # 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
13 entries across 13 versions & 1 rubygems