Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Commit 1525cf0

Browse files
committed
fixes #9
1 parent c619890 commit 1525cf0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/DateRangePicker.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ public function init()
8181
public function run()
8282
{
8383
if ($this->form) {
84-
Html::addCssClass($this->options, 'form-control datepicker-from');
85-
Html::addCssClass($this->optionsTo, 'form-control datepicker-to');
84+
Html::addCssClass($this->options, 'datepicker-from');
85+
Html::addCssClass($this->optionsTo, 'datepicker-to');
8686
$inputFrom = $this->form->field(
8787
$this->model,
8888
$this->attribute,
8989
[
9090
'template' => '{input}{error}',
91-
'options' => ['class' => 'datepicker-range form-control'],
91+
'options' => ['class' => 'input-group datepicker-range'],
9292
]
9393
)->textInput($this->options);
9494
$inputTo = $this->form->field(
9595
$this->model,
9696
$this->attributeTo,
9797
[
9898
'template' => '{input}{error}',
99-
'options' => ['class' => 'datepicker-range form-control'],
99+
'options' => ['class' => 'input-group datepicker-range'],
100100
]
101101
)->textInput($this->optionsTo);
102102
} else {

tests/functional/DateRangePickerTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ public function testRenderWithModel()
2222
'attribute' => 'date_from',
2323
'attributeTo' => 'date_to'
2424
]);
25-
$expected = '<div class="input-group input-daterange"><div class="datepicker-range form-control field-post-date_from">
26-
<input type="text" id="post-date_from" class="form-control form-control datepicker-from" name="Post[date_from]"><p class="help-block help-block-error"></p>
27-
</div><span class="input-group-addon">to</span><div class="datepicker-range form-control field-post-date_to">
28-
<input type="text" id="post-date_to" class="form-control form-control datepicker-to" name="Post[date_to]"><p class="help-block help-block-error"></p>
25+
$expected = '<div class="input-group input-daterange"><div class="input-group datepicker-range field-post-date_from">
26+
<input type="text" id="post-date_from" class="form-control datepicker-from" name="Post[date_from]"><p class="help-block help-block-error"></p>
27+
</div><span class="input-group-addon">to</span><div class="input-group datepicker-range field-post-date_to">
28+
<input type="text" id="post-date_to" class="form-control datepicker-to" name="Post[date_to]"><p class="help-block help-block-error"></p>
2929
</div></div>';
3030

3131
$this->assertEqualsWithoutLE($expected, $out);

0 commit comments

Comments
 (0)