app/controllers/anoubis/data/convert.rb
##
# Convert value from database to table view for datetime type
Convert value from database to table view for datetime type
Convert value from database to table view for datetime type
def convert_db_to_table_value_datetime1(key, field, value)
        begin
          value = case field[:format]
                  when 'month' then I18n.t('anoubis.months.main')[value.month-1]+' '+value.year.to_s
                  when 'date' then value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s
                  when 'datetime' then value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)
                  else value.day.to_s+' '+ I18n.t('anoubis.months.second')[value.month-1]+' '+value.year.to_s+', '+value.hour.to_s+':'+('%02d' % value.min)+':'+('%02d' % value.sec)
                  end
        rescue
          value = I18n.t('incorrect_field_format')
        end
        return { key => value }
      end
def convert_db_to_table_value_datetime1 ( key , field , value ) begin value = case field [ :format ] when 'month' then I18n . t ( 'anoubis.months.main' ) [ value . month - 1 ] + ' ' + value . year . to_s when 'date' then value . day . to_s + ' ' + I18n . t ( 'anoubis.months.second' ) [ value . month - 1 ] + ' ' + value . year . to_s when 'datetime' then value . day . to_s + ' ' + I18n . t ( 'anoubis.months.second' ) [ value . month - 1 ] + ' ' + value . year . to_s + ', ' + value . hour . to_s + ':' + ( '%02d' % value . min ) else value . day . to_s + ' ' + I18n . t ( 'anoubis.months.second' ) [ value . month - 1 ] + ' ' + value . year . to_s + ', ' + value . hour . to_s + ':' + ( '%02d' % value . min ) + ':' + ( '%02d' % value . sec ) end rescue value = I18n . t ( 'incorrect_field_format' ) end return { key => value } end
Convert value from database to table view for datetime type
Convert value from database to table view for datetime type
key
<not_specific>
field
<not_specific>
value
<not_specific>