telerik / kendo-ui-core

An HTML5, jQuery-based widget library for building modern web apps.
http://www.telerik.com/kendo-ui
Other
2.54k stars 1.91k forks source link

DateRangePicker inconsistent range selection #6665

Closed kendo-bot closed 2 weeks ago

kendo-bot commented 2 years ago

Bug Report

When you first select a range, the widget behaves as expected. When you open the rangepicker again and try to select a new range, starting from one of the dates in the current range and ending with a date that is outside of the current range, the datepicker selects only the last clicked date.

Additionally, in the Dojo example below a range from October-November 2021 is selected, however when the daterangepicker is first expanded, the visible view for the current month instead of the selection.

First reported in ticket 1546815.

Reproduction of the problem

Dojo: https://dojo.telerik.com/@sspasova/IvumEXeN

The second issue is that the displayed view is for the current month instead of the selected range from October to November. The workaround is to update the underlying dateView component.

kpicker.dateView.value(kpicker.range().start)

The first issue can be reproduced with the following steps:

Attempt 1:

Select an initial range. For example 10.12.2021 - 15.12.2021.

Open the rangepicker again and select from 12.12.2021 - 17.12.2021(the first date is part of the previous range, the second date is outside of the previous range).

Attempt 2:

Select an initial range. For example 10.12.2021 - 15.12.2021.

Open the rangepicker again and select from 12.12.2021-14.12.2021(both dates are a part of the previous range).

Current behavior

In Attempt 1, only 17th will be selected. In Attempt 2, the entire range 12.12-14.12 will be selected.

The view when the daterangepicker is expanded initially displays the current month.

Expected/desired behavior

The range selection should behave the same way in both cases. The view should display the current selection instead of the current month.

Environment

Kendo UI version: 2023.3.1114 Browser: [all]

gdenchevprog commented 2 years ago

Raising priority - ticket 1565933

IvanDanchev commented 2 years ago

Priority raised (Ticket ID: 1576835)

kim-tg commented 1 year ago

Priority raised

NikoPenev21 commented 10 months ago

Priority rased, new report in tickedID: 1631043

manuel-bitwise commented 2 months ago

Hello I got here from the telerik Forum and in the original question it also stated: 'Also, we can't only change the "start" or "end" easily, we always need to re-select the whole range.' we still have this problem in our version in asp.net core, we recently updatet to version 2024.2.514 Is this also a known issue which will be fixed? because in the demo's it works perfectly

gdenchevprog commented 1 month ago

Hello, everyone,

The entire selection behavior was revamped in v2024.2.514 so this bug is no longer valid. If users click on the "Start" input and they select a date, the "start" value will be updated. The same goes for the "End" input.

The 'reset' behavior that has been described in this issue is no longer present.

@manuel-bitwise the above statement should also address the question that you asked. If you're experiencing problems in the latest release, please open a private ticket/forum thread and share your configuration/project and information there.

The second part of the issue that concerns the initially displayed view is still valid. We'll see what's the best way to handle it.