Cleaned multi-lined comments to single line
git-svn-id: https://svn.eudat.eu/EUDAT/Services/MetaData/ckanext-datesearch@2720 68e52488-0a15-44bc-a314-416658652264
This commit is contained in:
parent
9f96c6dd55
commit
bb0dfaf115
|
@ -22,8 +22,7 @@ this.ckan.module('daterangepicker-module', function ($, _) {
|
||||||
$('#ext_enddate').val(param_end);
|
$('#ext_enddate').val(param_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add hidden <input> tags #ext_startdate and #ext_enddate,
|
// Add hidden <input> tags #ext_startdate and #ext_enddate, if they don't already exist.
|
||||||
// if they don't already exist.
|
|
||||||
var form = $("#dataset-search");
|
var form = $("#dataset-search");
|
||||||
// CKAN 2.1
|
// CKAN 2.1
|
||||||
if (!form.length) {
|
if (!form.length) {
|
||||||
|
@ -44,24 +43,20 @@ this.ckan.module('daterangepicker-module', function ($, _) {
|
||||||
keyboardNavigation: false,
|
keyboardNavigation: false,
|
||||||
autoclose: true
|
autoclose: true
|
||||||
}).on('hide', function (ev) {
|
}).on('hide', function (ev) {
|
||||||
// Bootstrap-daterangepicker calls this function after the user
|
// Bootstrap-daterangepicker calls this function after the user picks a start and end date.
|
||||||
// picks a start and end date.
|
|
||||||
|
|
||||||
// Format the start and end dates into strings in a date format
|
// Format the start and end dates into strings in a date format that Solr understands.
|
||||||
// that Solr understands.
|
|
||||||
var v = moment(ev.date);
|
var v = moment(ev.date);
|
||||||
var fs = 'YYYY-MM-DDTHH:mm:ss'
|
var fs = 'YYYY-MM-DDTHH:mm:ss'
|
||||||
|
|
||||||
switch (ev.target.name) {
|
switch (ev.target.name) {
|
||||||
case 'start':
|
case 'start':
|
||||||
// Set the value of the hidden <input id="ext_startdate"> to
|
// Set the value of the hidden <input id="ext_startdate"> to the chosen start date.
|
||||||
// the chosen start date.
|
|
||||||
$('#ext_startdate').val(v.format(fs) + 'Z');
|
$('#ext_startdate').val(v.format(fs) + 'Z');
|
||||||
break;
|
break;
|
||||||
case 'end':
|
case 'end':
|
||||||
// Set the value of the hidden <input id="ext_enddate"> to
|
// Set the value of the hidden <input id="ext_enddate"> to the chosen end date.
|
||||||
// the chosen end date.
|
$('#ext_enddate').val(v.add('y', 1).subtract('s', 1).format(fs) + 'Z');
|
||||||
$('#ext_enddate').val(v.add('y', 1).subtract('h', 3).format(fs) + 'Z');
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue