_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('ResetFieldX'), $label);
return '
'.$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}
';
case FormValidator::LAYOUT_HORIZONTAL:
return '
';
case FormValidator::LAYOUT_BOX_NO_LABEL:
return '{element}';
}
}
/**
* Get the necessary javascript for this datepicker.
*
* @return string
*/
private function getElementJS()
{
$js = null;
$id = $this->getAttribute('id');
//timeFormat: 'hh:mm'
$js .= "";
return $js;
}
}