Skip to content

Business intelligence made simple

Fixed infinite redirect

Andrew Kane9b6f0b2c1f65
diff --git a/app/views/blazer/_variables.html.erb b/app/views/blazer/_variables.html.erb
index 114097f1..efea31ea 100644
--- a/app/views/blazer/_variables.html.erb
+++ b/app/views/blazer/_variables.html.erb
@@ -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 %>