This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Description
Given the following array notation, the DateTime Element will indicate that the date information provided on submission is invalid. The cause for this is because the Element is presuming that the min / max validators will ALWAYS construct to a \DateTime object; however, in this case they return to null because the format is not compliant with the expected constant's string.
[
'spec' => [
'name' => 'start_time',
'type' => Zend\Form\Element\DateTime::class,
'options' => [
'label' => 'Appointment Date',
],
'attributes' => [
'min' => '2017-01-01',
'max' => '2017-12-29',
'step' => 1,
],
],
]
The following spec does work:
[
'spec' => [
'name' => 'start_time',
'type' => Zend\Form\Element\DateTime::class,
'options' => [
'label' => 'Appointment Date',
],
'attributes' => [
'min' => '2017-01-01T00:00+00:00',
'max' => '2017-12-29T23:59+00:00',
'step' => 1,
],
],
]