Skip to content

Commit

Permalink
Merge pull request #345 from jcn/filter-end
Browse files Browse the repository at this point in the history
For projects and finalists, when a start date is chosen, set the default end date to be the same
  • Loading branch information
jcn authored Mar 10, 2019
2 parents bf09f2a + 6b79f16 commit 2707140
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/finalists/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<% content_for :javascript do %>
<% javascript_tag do %>
$(window).load(function(){
$('#filter_start').datepicker({dateFormat: 'yy-mm-dd', onClose: function(){ $('#filter_start').blur() }});
$('#filter_start').datepicker({dateFormat: 'yy-mm-dd', onClose: function(dateText){ $('#filter_start').blur(); $('#filter_end').datepicker('option', 'defaultDate', dateText); $('#filter_end').blur() }});
$('#filter_end').datepicker({dateFormat: 'yy-mm-dd', onClose: function(){ $('#filter_end').blur() }});
});
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/projects/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<% content_for :javascript do %>
<% javascript_tag do %>
$(window).load(function(){
$('#filter_start').datepicker({dateFormat: 'yy-mm-dd', onClose: function(){ $('#filter_start').blur() }});
$('#filter_start').datepicker({dateFormat: 'yy-mm-dd', onClose: function(dateText){ $('#filter_start').blur(); $('#filter_end').datepicker('option', 'defaultDate', dateText); $('#filter_end').blur() }});
$('#filter_end').datepicker({dateFormat: 'yy-mm-dd', onClose: function(){ $('#filter_end').blur() }});
});
<% end %>
Expand Down

0 comments on commit 2707140

Please sign in to comment.