Add the code:
echo JHTML::_('calendar', '', 'name', 'id', '%d %B %Y %H:%M', array('size' => '20', 'showTime' => true));
at the beginning of the file administrator/components/com_content/tmpl/article/edit.php just after the line:
defined('_JEXEC') or die;
Then, create a new Joomla article
A calendar field should appear at the top of the view (that's the code we used until now to display the calendar form in our component):
https://monosnap.com/file/wbgLGakcGgtLIrCDOq1Q8S547I9QXD
The calendar field doesn't display the calendar when clicking on the button and a notice message appear:
https://monosnap.com/file/cyhd8P1ibyKz2Iu9tOI294heVyfCHO
"Notice : Undefined variable: dataAttribute in \layouts\joomla\form\field\calendar.php on line 117"
Clean Joomla 4 beta 1
Adding the line:
'dataAttribute' => '',
after the line:
'maxYear' => $maxYear,
in the file libraries/src/HTML/HTMLHelper.php fixes the problem but maybe there is a better way to fix it ? Or maybe another method should be used to load the calendar ?
| Labels |
Added:
?
|
||
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-06-02 00:34:46 |
| Closed_By | ⇒ | Quy |
Fixed in #29347.