Test if start or end is unset then clear hidden input
git-svn-id: https://svn.eudat.eu/EUDAT/Services/MetaData/ckanext-datesearch@2722 68e52488-0a15-44bc-a314-416658652264
This commit is contained in:
parent
e4c6b0452a
commit
9d9ae68788
|
@ -52,11 +52,19 @@ this.ckan.module('daterangepicker-module', function ($, _) {
|
|||
switch (ev.target.name) {
|
||||
case 'start':
|
||||
// Set the value of the hidden <input id="ext_startdate"> to the chosen start date.
|
||||
if (ev.date) {
|
||||
$('#ext_startdate').val(v.format(fs) + 'Z');
|
||||
} else {
|
||||
$('#ext_startdate').val('');
|
||||
}
|
||||
break;
|
||||
case 'end':
|
||||
// Set the value of the hidden <input id="ext_enddate"> to the chosen end date.
|
||||
if (ev.date) {
|
||||
$('#ext_enddate').val(v.add('y', 1).subtract('s', 1).format(fs) + 'Z');
|
||||
} else {
|
||||
$('#ext_enddate').val('');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue