Fix DateTime and Date pickers when they belongs to group - refs BT#10175

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 7f113943a9
commit 5857591725
  1. 24
      main/inc/lib/formvalidator/Element/DatePicker.php
  2. 24
      main/inc/lib/formvalidator/Element/DateTimePicker.php

@ -32,9 +32,29 @@ class DatePicker extends HTML_QuickForm_text
*/
public function toHtml()
{
$js = $this->getElementJS();
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
}
$id = $this->getAttribute('id');
$value = $this->getValue();
if (!empty($value)) {
$value = api_format_date($value, DATE_TIME_FORMAT_LONG_24H);
}
if (empty($this->getLabel())) {
return $this->getElementJS() . '
<div class="input-group">
<span class="input-group-addon">
<input ' . $this->_getAttrString($this->_attributes) . '>
</span>
<input class="form-control" type="text" readonly id="' . $id . '_alt" value="' . $value . '">
</div>
';
}
return $js.parent::toHtml();
return $this->getElementJS() . parent::toHtml();
}
/**

@ -26,9 +26,29 @@ class DateTimePicker extends HTML_QuickForm_text
*/
public function toHtml()
{
$js = $this->getElementJS();
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
}
$id = $this->getAttribute('id');
$value = $this->getValue();
if (!empty($value)) {
$value = api_format_date($value, DATE_TIME_FORMAT_LONG_24H);
}
if (empty($this->getLabel())) {
return $this->getElementJS() . '
<div class="input-group">
<span class="input-group-addon">
<input ' . $this->_getAttrString($this->_attributes) . '>
</span>
<input class="form-control" type="text" readonly id="' . $id . '_alt" value="' . $value . '">
</div>
';
}
return $js.parent::toHtml();
return $this->getElementJS() . parent::toHtml();
}
/**

Loading…
Cancel
Save