Sha256: 733e8166f6494d83408220df4f93294305ffedd6f7be90c875dbc108b20f4e67
Contents?: true
Size: 869 Bytes
Versions: 42
Compression:
Stored size: 869 Bytes
Contents
# -*- encoding : utf-8 -*- InlineForms::SPECIAL_COLUMN_TYPES[:date_select]=:date # date def date_select_show(object, attribute) link_to_inline_edit object, attribute, object.send(attribute).nil? ? "" : object.send(attribute).strftime("%d-%m-%Y") end def date_select_edit(object, attribute) css_id = 'datepicker_' + object.class.to_s.underscore + '_' + object.id.to_s + '_' + attribute.to_s out = text_field_tag attribute, ( object.send(attribute).nil? ? "" : object.send(attribute).strftime("%d-%m-%Y") ), :id => css_id out << '<SCRIPT>'.html_safe out << "$(function() { ".html_safe out << '$("#'.html_safe + css_id.html_safe + '").datepicker({ yearRange: "-100:+5" });'.html_safe out << '});'.html_safe out << '</SCRIPT>'.html_safe return out end def date_select_update(object, attribute) object[attribute.to_sym] = params[attribute.to_sym] end
Version data entries
42 entries across 42 versions & 1 rubygems