Skip to content

Commit 587b813

Browse files
author
korepashka
authored
Merge pull request #1 from korepashka/korepashka-patch-1
Make form-control class optional for input
2 parents 92e04c6 + 6ca7932 commit 587b813

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

DatePicker.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ protected function renderDatePicker()
233233
$this->layout = '{input1}{separator}{input2}';
234234
}
235235
}
236+
237+
if (empty($this->options['class'])) {
238+
Html::addCssClass($this->options, 'form-control');
239+
}
236240
Html::addCssClass($this->options, 'krajee-datepicker');
237241
$this->options['data-datepicker-source'] = $this->type === self::TYPE_INPUT ? $this->options['id'] :
238242
$this->_container['id'];
@@ -296,7 +300,6 @@ protected function validateConfig()
296300
*/
297301
protected function renderInput()
298302
{
299-
Html::addCssClass($this->options, 'form-control');
300303
if ($this->type == self::TYPE_INLINE) {
301304
if (empty($this->options['readonly'])) {
302305
$this->options['readonly'] = true;

0 commit comments

Comments
 (0)