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

Fix default ranges #102

Closed s1lver closed 7 years ago

s1lver commented 7 years ago

Scope

This pull request includes a

Changes

Related Issues

There is an error where it is not possible to override the default value for "ranges" This code has no effect:

DateRangePicker::className(), [
    'presetDropdown' => true,
    'hideInput' => true,
    'pluginOptions' => [
        'ranges' => [
            'Неделя' => ["moment().startOf('day').subtract(6, 'days')", "moment()"],
        ]
    ]
]
kartik-v commented 7 years ago

Just set presetDropdown to false. Then you can overwrite ranges. This PR may not be needed. If you feel something different - update and I will reopen this issue.

s1lver commented 7 years ago

Thanks!