Module: Admin::Resources::DataTypes::DatetimeHelper

Defined in:
app/helpers/admin/resources/data_types/datetime_helper.rb

Instance Method Summary collapse

Instance Method Details

#display_datetime(item, attribute) ⇒ Object Also known as: display_date



13
14
15
# File 'app/helpers/admin/resources/data_types/datetime_helper.rb', line 13

def display_datetime(item, attribute)
  I18n.l(item.send(attribute), :format => @resource.typus_date_format(attribute))
end

#table_datetime_field(attribute, item) ⇒ Object Also known as: table_date_field, table_time_field, table_timestamp_field



3
4
5
6
7
# File 'app/helpers/admin/resources/data_types/datetime_helper.rb', line 3

def table_datetime_field(attribute, item)
  if field = item.send(attribute)
    I18n.localize(field, :format => item.class.typus_date_format(attribute))
  end
end