Skip to content

Commit

Permalink
fix(date filter) add templating relaed attributes and fix names; affe…
Browse files Browse the repository at this point in the history
…cts #288
  • Loading branch information
tuurma committed Nov 29, 2017
1 parent 381a91d commit 7553501
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
14 changes: 8 additions & 6 deletions modules/search.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -484,17 +484,19 @@ declare %private function search:query-sections($sections as xs:string*, $volume
declare function search:query-section($category, $query as xs:string) {

let $start-date := string-join(
(request:get-parameter("start-date3", '1865'),
request:get-parameter("start-date1", '04'),
request:get-parameter("start-date2", '28')), '-'
(request:get-parameter("start_date_3", '1865'),
request:get-parameter("start_date_1", '04'),
request:get-parameter("start_date_2", '28')), '-'
)

let $end-date := string-join(
(request:get-parameter("end-date3", '1995'),
request:get-parameter("end-date1", '05'),
request:get-parameter("end-date2", '27')), '-'
(request:get-parameter("end_date_3", '1995'),
request:get-parameter("end_date_1", '05'),
request:get-parameter("end_date_2", '27')), '-'
)

let $c:=console:log($start-date || ' -- ' || $end-date)

let $start-time:=''
let $end-time:=''

Expand Down
18 changes: 15 additions & 3 deletions pages/search/_filter-date.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ <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>
<<<<<<< HEAD
<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">
Expand All @@ -23,6 +24,17 @@ <h3 class="hsg-sidebar-title-second-level">From</h3>
<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_year" type="number" min="1600" max="2025" step="1" value=""/>
=======
<input class="hsg-input-inline form-control" data-template="templates:form-control" placeholder="mm" aria-describedby="startDateHint" id="start_date_1" name="start_date_1" 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 form-control" data-template="templates:form-control" placeholder="dd" aria-describedby="startDateHint" id="start_date_2" name="start_date_2" 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 form-control" data-template="templates:form-control" placeholder="yyyy" aria-describedby="startDateHint" id="start_date_3" name="start_date_3" type="number" min="1600" max="2025" step="1" value=""/>
>>>>>>> fix(date filter) add templating relaed attributes and fix names; affects #288
</div>
</div>
</fieldset>
Expand Down Expand Up @@ -71,15 +83,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_month" type="number" min="1" max="12" step="1" value=""/>
<input class="hsg-input-inline form-control" data-template="templates:form-control" placeholder="mm" aria-describedby="endDateHint" id="end_date_1" name="end_date_1" 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_day" type="number" min="1" max="31" step="1" value=""/>
<input class="hsg-input-inline form-control" data-template="templates:form-control" placeholder="dd" aria-describedby="endDateHint" id="end_date_2" name="end_date_2" 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_year" type="number" min="1600" max="2025" step="1" value=""/>
<input class="hsg-input-inline form-control" data-template="templates:form-control" placeholder="yyyy" aria-describedby="endDateHint" id="end_date_3" name="end_date_3" type="number" min="1600" max="2025" step="1" value=""/>
</div>
</div>
</fieldset>
Expand Down

0 comments on commit 7553501

Please sign in to comment.