diff --git a/app/views/cost_reports/filter_types/_date_exact.rhtml b/app/views/cost_reports/filter_types/_date_exact.rhtml new file mode 100644 index 0000000000..423c8657af --- /dev/null +++ b/app/views/cost_reports/filter_types/_date_exact.rhtml @@ -0,0 +1,13 @@ +<%= text_field_tag "#{name_prefix}[values][]", (filter.values.first if filter.values), :size => 10, :class => "select-small", :id => "#{id_prefix}_date1"%> <%= calendar_for("#{id_prefix}_date1") %> + +<% + between_tags = + l(:label_until) + " " + + text_field_tag("#{name_prefix}[values][]", (filter.values.last if filter.values), :size => 10, :class => "select-small", :id => "#{id_prefix}_date2") + " " + + calendar_for("#{id_prefix}_date2") +%> + +<%= javascript_tag "#{id_prefix}_between_tags = '#{escape_javascript(between_tags)}';" %> +<%= observe_field "#{id_prefix}_operator", :function => "if (value == '<>d') {$('#{id_prefix}_between_tags').update(#{id_prefix}_between_tags);} else {$('#{id_prefix}_between_tags').update('');}" %> +<%= between_tags if filter.operator == '<>d' %> +