Skip to content

Commit

Permalink
fix(search): Fix serialization of date parameters #288
Browse files Browse the repository at this point in the history
* rename input names of #dateFilter form
* serialize the form
* add divider before date parameters
  • Loading branch information
plutonik-a committed Nov 29, 2017
1 parent 3265e4e commit a5f0358
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
20 changes: 10 additions & 10 deletions pages/search/_filter-date.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ <h3 class="hsg-sidebar-title-second-level">From</h3>
<div class="hsg-start-date">
<div class="hsg-form-group hsg-form-group-month">
<label for="start_date_1">Month</label>
<input class="hsg-input-inline" placeholder="mm" aria-describedby="startDateHint" id="start_date_1" name="start_date" type="number" min="1" max="12" step="1" value=""/>
<input class="hsg-input-inline" placeholder="mm" aria-describedby="startDateHint" id="start_date_1" name="start_month" type="number" min="1" max="12" step="1" value=""/>
</div>
<div class="hsg-form-group hsg-form-group-day">
<label for="start_date_2">Day</label>
<input class="hsg-input-inline" placeholder="dd" aria-describedby="startDateHint" id="start_date_2" name="start_date" type="number" min="1" max="31" step="1" value=""/>
<input class="hsg-input-inline" placeholder="dd" aria-describedby="startDateHint" id="start_date_2" name="start_day" type="number" min="1" max="31" step="1" value=""/>
</div>
<div class="hsg-form-group hsg-form-group-year">
<label for="start_date_3">Year</label>
<input class="hsg-input-inline" placeholder="yyyy" aria-describedby="startDateHint" id="start_date_3" name="start_date" type="number" min="1600" max="2025" step="1" value=""/>
<input class="hsg-input-inline" placeholder="yyyy" aria-describedby="startDateHint" id="start_date_3" name="start_year" type="number" min="1600" max="2025" step="1" value=""/>
</div>
</div>
</fieldset>
Expand All @@ -33,11 +33,11 @@ <h3 class="hsg-sidebar-title-second-level">From</h3>
<div>
<div class="hsg-form-group hsg-form-group-month">
<label for="start_time_1">Hour</label>
<input class="hsg-input-inline" placeholder="hh" aria-describedby="startTimeHint" id="start_time_1" name="start_time" type="number" min="0" max="12" step="1" value=""/>
<input class="hsg-input-inline" placeholder="hh" aria-describedby="startTimeHint" id="start_time_1" name="start_hour" type="number" min="0" max="12" step="1" value=""/>
</div>
<div class="hsg-form-group hsg-form-group-day">
<label for="end_time_2">Minute</label>
<input class="hsg-input-inline" placeholder="mm" aria-describedby="startTimeHint" id="start_time_2" name="start_time" type="number" min="0" max="60" step="1" value=""/>
<input class="hsg-input-inline" placeholder="mm" aria-describedby="startTimeHint" id="start_time_2" name="start_minute" type="number" min="0" max="60" step="1" value=""/>
</div>
<div class="hsg-form-group hsg-time-input-group hsg-search-inputs-horizontal">
<ul>
Expand Down Expand Up @@ -70,15 +70,15 @@ <h3 class="hsg-sidebar-title-second-level">To</h3>
<div class="hsg-start-time">
<div class="hsg-form-group hsg-form-group-month">
<label for="end_date_1">Month</label>
<input class="hsg-input-inline" placeholder="mm" aria-describedby="endDateHint" id="end_date_1" name="end_date" type="number" min="1" max="12" step="1" value=""/>
<input class="hsg-input-inline" placeholder="mm" aria-describedby="endDateHint" id="end_date_1" name="end_month" type="number" min="1" max="12" step="1" value=""/>
</div>
<div class="hsg-form-group hsg-form-group-day">
<label for="end_date_2">Day</label>
<input class="hsg-input-inline" placeholder="dd" aria-describedby="endDateHint" id="end_date_2" name="end_date" type="number" min="1" max="31" step="1" value=""/>
<input class="hsg-input-inline" placeholder="dd" aria-describedby="endDateHint" id="end_date_2" name="end_day" type="number" min="1" max="31" step="1" value=""/>
</div>
<div class="hsg-form-group hsg-form-group-year">
<label for="end_date_3">Year</label>
<input class="hsg-input-inline" placeholder="yyyy" aria-describedby="endDateHint" id="end_date_3" name="end_date" type="number" min="1600" max="2025" step="1" value=""/>
<input class="hsg-input-inline" placeholder="yyyy" aria-describedby="endDateHint" id="end_date_3" name="end_year" type="number" min="1600" max="2025" step="1" value=""/>
</div>
</div>
</fieldset>
Expand All @@ -89,11 +89,11 @@ <h3 class="hsg-sidebar-title-second-level">To</h3>
<div>
<div class="hsg-form-group hsg-form-group-month">
<label for="end_time_1">Hour</label>
<input class="hsg-input-inline" placeholder="hh" aria-describedby="endTimeHint" id="end_time_1" name="end_time" type="number" min="0" max="12" step="1" value=""/>
<input class="hsg-input-inline" placeholder="hh" aria-describedby="endTimeHint" id="end_time_1" name="end_hour" type="number" min="0" max="12" step="1" value=""/>
</div>
<div class="hsg-form-group hsg-form-group-day">
<label for="end_time_2">Minute</label>
<input class="hsg-input-inline" placeholder="mm" aria-describedby="endTimeHint" id="end_time_2" name="end_time" type="number" min="0" max="60" step="1" value=""/>
<input class="hsg-input-inline" placeholder="mm" aria-describedby="endTimeHint" id="end_time_2" name="end_minute" type="number" min="0" max="60" step="1" value=""/>
</div>
<div class="hsg-form-group hsg-time-input-group hsg-search-inputs-horizontal">
<ul>
Expand Down
5 changes: 1 addition & 4 deletions resources/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,9 @@ $(document).ready(function() {
function submitSearch (event) {
event.preventDefault();
var action = searchForm.serialize();
action += '&' + dateFilter.serialize();
action += serializeFiltersByName(queryForm, 'match');
action += serializeFiltersByName(formFilters, 'section');
//action += serializeFiltersByName(dateFilter, 'start_date');
//action += serializeFiltersByName(dateFilter, 'end_date');
//action += serializeFiltersByName(dateFilter, 'start_time');
//action += serializeFiltersByName(dateFilter, 'end_time');
action += serializeFiltersByName(sectionFilter, 'within');

var currentActiveSorting = sortingForm.find('.active');
Expand Down

0 comments on commit a5f0358

Please sign in to comment.