Use such code to load a Joomla calendar in a form.
echo JHTML::_('calendar', '', 'filter_start','period_start','%d %B %Y',array('size'=>'10','onchange'=>'document.adminForm.submit();', 'onChange'=>'document.adminForm.submit();'));
When you select a date in the calendar, the form with the name adminForm is submitted.
When you use the clear button to clear the date in the calendar the date is cleared in the input field and the onchange event should be called
When you use the clear button to clear the date in the calendar the date is cleared in the input field but the onchange event is not called.
This can be reproduced if you install HikaShop Starter on your website with the orders listing in the backend (menu Components->HikaShop->Orders). We use the Joomla calendar to to filter the orders listing by date ranges.
We were able to fix the issue by adding the code:
self.inputField.onchange();
after the code:
self.inputField.setAttribute('data-alt-value', "0000-00-00 00:00:00"); self.inputField.setAttribute('value', ''); self.inputField.value = '';
in the file media/system/js/fields/calendar.js
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-11-12 11:00:34 |
Closed_By | ⇒ | alikon |
Closed_By | alikon | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/27054
please test #27055
The modification was tested on our end and I can confirm that the change fixes the issue. I made a PR accordingly. Note that I also modified the calendar.min.js file manually to reflect the change for when the "debug" mode is not activated.