_appendName = true; } /** * HTML code to display this datepicker. * * @return string */ public function toHtml() { if ($this->_flagFrozen) { return $this->getFrozenHtml(); } $id = $this->getAttribute('id'); $value = $this->getValue(); $formattedValue = ''; if (!empty($value)) { $formattedValue = api_format_date($value, DATE_TIME_FORMAT_LONG_24H); } $label = $this->getLabel(); if (is_array($label) && isset($label[0])) { $label = $label[0]; } $resetFieldX = sprintf(get_lang('Reset %s'), $label); return '
_getAttrString($this->_attributes).'>

'.$formattedValue.'

'.$this->getElementJS(); } /** * @param string $value */ public function setValue($value) { $value = substr($value, 0, 16); $this->updateAttributes(['value' => $value]); } /** * @param string $layout * * @return string */ public function getTemplate($layout) { $size = $this->calculateSize(); switch ($layout) { case FormValidator::LAYOUT_INLINE: return '
{element}
'; break; case FormValidator::LAYOUT_HORIZONTAL: return '
{icon} {element}

{label_2}

{error}
{label_3}
'; break; case FormValidator::LAYOUT_BOX_NO_LABEL: return '{element}'; break; } } /** * Get the necessary javascript for this datepicker. * * @return string */ private function getElementJS() { $js = null; $id = $this->getAttribute('id'); //timeFormat: 'hh:mm' $js .= ""; return $js; } }