Skip to content

Commit

Permalink
Edit date-picker for advanced search
Browse files Browse the repository at this point in the history
  • Loading branch information
JunWei96 committed Jan 26, 2018
1 parent 1b367f8 commit 78e8db9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ $(document).on("focus", "[data-behaviour~='datepicker']", function(e){
"autoclose": true,
"startDate": "0d"});
});

$(document).on("focus", "[data-behaviour~='datepicker-for-advsearch']", function(e){
$(this).datepicker({"format": "dd-mm-yyyy",
"weekStart": 1,
"autoclose": true });
});
2 changes: 1 addition & 1 deletion app/views/advanced_searches/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= f.text_field :description, class: 'form-control' %>

<%= f.label "Due date's date range" %>
<div class="input-daterange input-group" data-behaviour='datepicker' id="datepicker">
<div class="input-daterange input-group" data-behaviour='datepicker-for-advsearch' id="datepicker">
<%= f.text_field :due_date_start, class: 'form-control' %>
<span class="input-group-addon">to</span>
<%= f.text_field :due_date_end, class: 'form-control' %>
Expand Down

0 comments on commit 78e8db9

Please sign in to comment.