in my custom component I have a calendar field which I render in my view.
Database field :
Name: estEventDate Type: date Null: No Default: 0000-00-00
XML Field :
<field name="estEventDate" type="calendar"
format="%Y-%m-%d"
todaybutton="false"
filltable="false"
showtime="false"
size="22"
class="validate-dates uk-input"
minyear="0"/>
The php file tmpl/default.php
<div>
<?php echo $this->form->renderField('estEventDate'); ?>
</div>
The erros is : 0 DateTime::__construct(): Failed to parse time string (-1-11-30) at position 5 (-): Double timezone specification
And in the log I get this :
error Uncaught \Throwable of type Exception thrown. Stack trace:
#0 /home/mike/joomla/libraries/src/Date/Date.php(112): DateTime->__construct('-1-11-30', Object(DateTimeZone))
#1 /home/mike/joomla/libraries/src/Factory.php(548): Joomla\CMS\Date\Date->__construct('-1-11-30', Object(DateTimeZone))
#2 /home/mike/joomla/libraries/joomla/form/fields/calendar.php(238): Joomla\CMS\Factory::getDate('-1-11-30', 'UTC')
#3 /home/mike/joomla/libraries/src/Form/FormField.php(975): JFormFieldCalendar->getInput()
#4 /home/mike/joomla/libraries/src/Form/Form.php(670): Joomla\CMS\Form\FormField->renderField(Array)
#5 /home/mike/joomla/components/com_contract/views/contract/tmpl/edit_admin.php(95): Joomla\CMS\Form\Form->renderField('estEventDate')
I have tried different options in the xml. (like format,translateformat etc) I also have set a date directly in the database (I thought that mayby '0000-00-00' value was the problem)
Joomla v. 3.9.0 / php 7.2