|
@@ -20,7 +20,12 @@
|
|
|
<%= text_field_tag var, params[var], style: "width: 120px; margin-right: 20px;", autofocus: i == 0 && !var.end_with?("_at") && !params[var], class: "form-control" %>
|
|
|
<% if var.end_with?("_at") %>
|
|
|
<script>
|
|
|
- $("#<%= var %>").daterangepicker({singleDatePicker: true, locale: {format: "YYYY-MM-DD"}});
|
|
|
+ $("#<%= var %>").daterangepicker({singleDatePicker: true, locale: {format: "YYYY-MM-DD"}, autoUpdateInput: false});
|
|
|
+ // hack to start with empty date
|
|
|
+ $("#<%= var %>").on("apply.daterangepicker", function(ev, picker) {
|
|
|
+ $(this).val(picker.startDate.format("YYYY-MM-DD"));
|
|
|
+ $(this).change();
|
|
|
+ });
|
|
|
</script>
|
|
|
<% end %>
|
|
|
<% end %>
|