public function addToFormContainer(Nette\Forms\Container $container)
{
$container = $container->addContainer($this->key);
$container->addText('from', $this->name)->setAttribute('data-provide', 'datepicker')->setAttribute('data-date-orientation', 'bottom')->setAttribute('data-date-format', $this->getJsFormat())->setAttribute('data-date-today-highlight', 'true')->setAttribute('data-date-autoclose', 'true');
$container->addText('to', $this->name_second)->setAttribute('data-provide', 'datepicker')->setAttribute('data-date-orientation', 'bottom')->setAttribute('data-date-format', $this->getJsFormat())->setAttribute('data-date-today-highlight', 'true')->setAttribute('data-date-autoclose', 'true');
$this->addAttributes($container['from']);
$this->addAttributes($container['to']);
if ($this->grid->hasAutoSubmit()) {
$container['from']->setAttribute('data-autosubmit-change', TRUE);
$container['to']->setAttribute('data-autosubmit-change', TRUE);
}
if ($placeholder_array = $this->getPlaceholder()) {
$text_from = reset($placeholder_array);
if ($text_from) {
$container['from']->setAttribute('placeholder', $text_from);
}
$text_to = end($placeholder_array);
if ($text_to && $text_to != $text_from) {
$container['to']->setAttribute('placeholder', $text_to);
}
}
}