Sha256: 7c9e977a7dc60ea438d51c144769c9cbf2c267cb01ebde4b7c4ce38d0d534fe3
Contents?: true
Size: 928 Bytes
Versions: 41
Compression:
Stored size: 928 Bytes
Contents
# -*- encoding : utf-8 -*- InlineForms::SPECIAL_COLUMN_TYPES[:time_select]=:time # time def time_select_show(object, attribute) link_to_inline_edit object, attribute, object.send(attribute).nil? ? "<i class='fi-plus'></i>".html_safe : object.send(attribute).to_datetime.strftime("%l:%M%P") end def time_select_edit(object, attribute) css_id = 'timepicker_' + object.class.to_s.underscore + '_' + object.id.to_s + '_' + attribute.to_s out = text_field_tag attribute, ( object.send(attribute).nil? ? "" : object.send(attribute).to_datetime.strftime("%l:%M%P") ), :id => css_id, :class =>'timepicker' out << "<script>$('##{css_id}').timepicker();</script>".html_safe end def time_select_update(object, attribute) object[attribute.to_sym] = params[attribute.to_sym] end def time_select_info(object, attribute) object.send(attribute).nil? ? "-" : object.send(attribute).to_date end
Version data entries
41 entries across 41 versions & 1 rubygems