diff --git a/ckanext/datesearch/fanstatic/daterangepicker-module.js b/ckanext/datesearch/fanstatic/daterangepicker-module.js
index 3c24921..504f556 100644
--- a/ckanext/datesearch/fanstatic/daterangepicker-module.js
+++ b/ckanext/datesearch/fanstatic/daterangepicker-module.js
@@ -22,8 +22,7 @@ this.ckan.module('daterangepicker-module', function ($, _) {
$('#ext_enddate').val(param_end);
}
- // Add hidden tags #ext_startdate and #ext_enddate,
- // if they don't already exist.
+ // Add hidden tags #ext_startdate and #ext_enddate, if they don't already exist.
var form = $("#dataset-search");
// CKAN 2.1
if (!form.length) {
@@ -44,24 +43,20 @@ this.ckan.module('daterangepicker-module', function ($, _) {
keyboardNavigation: false,
autoclose: true
}).on('hide', function (ev) {
- // Bootstrap-daterangepicker calls this function after the user
- // picks a start and end date.
+ // Bootstrap-daterangepicker calls this function after the user picks a start and end date.
- // Format the start and end dates into strings in a date format
- // that Solr understands.
+ // Format the start and end dates into strings in a date format that Solr understands.
var v = moment(ev.date);
var fs = 'YYYY-MM-DDTHH:mm:ss'
switch (ev.target.name) {
case 'start':
- // Set the value of the hidden to
- // the chosen start date.
+ // Set the value of the hidden to the chosen start date.
$('#ext_startdate').val(v.format(fs) + 'Z');
break;
case 'end':
- // Set the value of the hidden to
- // the chosen end date.
- $('#ext_enddate').val(v.add('y', 1).subtract('h', 3).format(fs) + 'Z');
+ // Set the value of the hidden to the chosen end date.
+ $('#ext_enddate').val(v.add('y', 1).subtract('s', 1).format(fs) + 'Z');
break;
}