?
avatar hikashop-nicolas
hikashop-nicolas
12 Nov 2019

Steps to reproduce the issue

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.

Expected result

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

Actual result

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.

System information (as much as possible)

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.

Additional comments

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

avatar hikashop-nicolas hikashop-nicolas - open - 12 Nov 2019
avatar joomla-cms-bot joomla-cms-bot - change - 12 Nov 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 Nov 2019
avatar hikashop-nicolas
hikashop-nicolas - comment - 12 Nov 2019

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.

avatar joomla-cms-bot joomla-cms-bot - close - 12 Nov 2019
avatar alikon alikon - change - 12 Nov 2019
Status New Closed
Closed_Date 0000-00-00 00:00:00 2019-11-12 11:00:34
Closed_By alikon
avatar joomla-cms-bot joomla-cms-bot - change - 12 Nov 2019
Closed_By alikon joomla-cms-bot
avatar joomla-cms-bot
joomla-cms-bot - comment - 12 Nov 2019

Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/27054

avatar alikon
alikon - comment - 12 Nov 2019

please test #27055


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27054.

Add a Comment

Login with GitHub to post a comment