kartik-v / yii2-date-range

A Date Range Picker for Bootstrap useful for reports and filtering.
http://demos.krajee.com/date-range
Other
93 stars 81 forks source link

The first value in the list of predefined dates is not filled #130

Closed s1lver closed 5 years ago

s1lver commented 6 years ago

Problem

When you first open the list of preset dates, the default is "Today". But when you try to select "Today", this option does not apply. After selecting any other option, the "Today" item is applied normally. A similar situation with any other date set by default.

I have not found the option to change this behavior.

default

default

When clicking, the value is not set.

My config:

[
'filterType' => GridView::FILTER_DATE_RANGE,
'filterWidgetOptions' => [
    'options' => [
        style' => 'cursor:pointer;'
    ],
        'pluginOptions' => [
           'locale' => [
        'format' => 'DD.MM.YYYY',
        'separator' => ' по '
    ],
    'allowClear' => true,
    'autoclose' => true,
    'format' => 'DD.MM.YYYY',
    'separator' => ' по '
],
'presetDropdown' => true
],
'attribute' => 'create_date',
'value' => 'create_date',
'options' => ['width' => '240px']
]

I've prepared a solution to change this behavior, but I would like to ask first. Perhaps there is some option that changes this behavior, but I did not find it?

Operating System

Libraries

raflyazf commented 5 years ago

did you already found the solution? I got same problem

uagrace commented 5 years ago

v1.6.7 works fine

kartik-v commented 5 years ago

Use v1.7.1 - this should have been resolved.