<% options, attrs = attributes.partition_hash(['altField', 'altFormat', 'appendText', 'buttonImage', 'buttonImageOnly', 'buttonText', 'changeMonth', 'changeYear', 'closeText', 'constrainInput', 'currentText', 'dateFormat', 'dayNames', 'dayNamesMin', 'dayNamesShort', 'defaultDate', 'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL', 'maxDate', 'minDate', 'monthNames', 'monthNamesShort', 'navigationAsDateFormat', 'nextText', 'numberOfMonths', 'prevText', 'selectOtherMonths','shortYearCutoff', 'showAnim', 'showButtonPanel', 'showCurrentAtPos', 'showMonthAfterYear', 'showOn', 'showOptions', 'showOtherMonths', 'stepMonths', 'yearRange']) options["dateFormat"]||=begin d=I18n.t(:"date.formats.default") {"%Y" => "yy", "%y" => "y", "%m" => "mm", "%_m" => "m", "%-m" => "m", "%B" => "MM", "%^B" => "MM", "%b" => "M", "%^b" => "M", "%h" => "M", "%d" => "dd", "%-d" => "d", "%j" => "oo", "%D" => "mm/dd/y", "%F" => "yy-mm-dd", "%x" => "mm/dd/y"}.each {|rb, js| d.gsub!(rb,js)} d end events, html_attrs = attrs.partition_hash(['beforeShow', 'beforeShowDay', 'onChangeMonthYear', 'onClose', 'onSelect']) add_data_rapid!(html_attrs, "datepicker", :options => options, :events => events) %> <%= text_field_tag(name, this.nil? ? '' : I18n.l(this), deunderscore_attributes(html_attrs)) %>