public function time($fieldName, array $options = [])
{
$options += ['empty' => true, 'value' => null, 'interval' => 1, 'round' => null, 'timeFormat' => 24, 'second' => false];
$options['year'] = $options['month'] = $options['day'] = false;
$options = $this->_initInputField($fieldName, $options);
$options = $this->_datetimeOptions($options);
return $this->widget('datetime', $options);
}
/** * Generate time inputs. * * ### Options: * * See dateTime() for time options. * * @param string $fieldName Prefix name for the SELECT element * @param array $options Array of Options * @return string Generated set of select boxes for time formats chosen. * @see Cake\View\Helper\FormHelper::dateTime() for templating options. */ public function time($fieldName, array $options = []) { $fields = ['hour' => true, 'minute' => true, 'second' => false, 'timeFormat' => false]; $this->templates(['dateWidget' => $this->_getDatetimeTemplate($fields, $options)]); return parent::time($fieldName, $options); }