|
|
@@ -4,8 +4,11 @@ Script |
|
|
|
static |
|
|
|
main () |
|
|
|
{ |
|
|
|
$ ('#filter-date-start').datepicker (); |
|
|
|
$ ('#filter-date-end').datepicker (); |
|
|
|
const dateOptions = {dateFormat: 'yy-mm-dd', |
|
|
|
firstDay: 6}; |
|
|
|
|
|
|
|
$ ('#filter-date-start').datepicker (dateOptions); |
|
|
|
$ ('#filter-date-end').datepicker (dateOptions); |
|
|
|
|
|
|
|
const url = new URL (window.location.href); |
|
|
|
|
|
|
@@ -17,6 +20,14 @@ Script |
|
|
|
const filter = ( |
|
|
|
function (e) |
|
|
|
{ |
|
|
|
let dateStart = $ ('#filter-date-start').val (); |
|
|
|
let dateEnd = $ ('#filter-date-end').val (); |
|
|
|
|
|
|
|
if ((dateStart !== '') |
|
|
|
&& (dateEnd !== '') |
|
|
|
&& (dateStart > dateEnd)) |
|
|
|
[dateStart, dateEnd] = [dateEnd, dateStart]; |
|
|
|
|
|
|
|
url.searchParams.delete ('p'); |
|
|
|
|
|
|
|
url.searchParams.delete ('asc'); |
|
|
@@ -25,6 +36,15 @@ Script |
|
|
|
url.searchParams.delete ('q'); |
|
|
|
url.searchParams.append ('q', filterKeyword.value); |
|
|
|
|
|
|
|
url.searchParams.delete ('start'); |
|
|
|
url.searchParams.delete ('end'); |
|
|
|
|
|
|
|
if (dateStart !== '') |
|
|
|
url.searchParams.append ('start', dateStart); |
|
|
|
|
|
|
|
if (dateEnd !== '') |
|
|
|
url.searchParams.append ('end', dateEnd); |
|
|
|
|
|
|
|
window.location.href = url; |
|
|
|
}); |
|
|
|
|
|
|
|