public function getControl()
{
$control = parent::getControl();
$control->type = $this->htmlType;
$control->addClass($this->htmlType);
$control->{'data-nette-rules'} = null;
list($min, $max) = $this->extractRangeRule($this->getRules());
if ($min instanceof DateTime) {
$control->min = $min->format($this->htmlFormat);
}
if ($max instanceof DateTime) {
$control->max = $max->format($this->htmlFormat);
}
$value = $this->getValue();
if ($value instanceof DateTime) {
$control->value = $value->format($this->htmlFormat);
}
return $control;
}