Declined
Last Updated: 21 Aug 2019 06:50 by ADMIN
Aleksandr
Created on: 14 Aug 2019 07:35
Category: Date/Time Pickers
Type: Bug Report
0
datetime picker does not show current date if empty

dojo example

 

https://dojo.telerik.com/iyEXeDoH/7

 

we set same data for all 3 pickers, 1 & 3 open immediately as soon as we set the date & than clear them, 2 first clear than open, in the end all cleared but some still show any date but current

 

what we want:

if we set the date & than cleared DP, DP should show current date despite was it opened or not

1 comment
ADMIN
Tsvetomir
Posted on: 21 Aug 2019 06:50
Hi Aleksandr,

Thank you for the provided Dojo sample along with details related to the case.

By default, from a User Experience point of view, all of the Date pickers remember the last view in which they have been opened. Therefore, if you navigate to a different month, close and reopen the picker, the last view would be shown. 

Regarding the example provided, there is a difference between the order of opening and erasing the value. Here are a few clarifications on each of the scenarios:

kendoDatePicker1.open(); // First, open the picker
kendoDatePicker1.value(""); // Second, clear the value

In the example above, firstly the picker would be opened in the view in which the initial value is. Then, it would be erased. And if it gets closed and reopened, it would automatically navigate to the lastly selected view (1/1/2011). This best could be explained with a setTimeout method. 

https://screencast-o-matic.com/watch/cqjr15tQHu

In the second case, first the value is erased and then, the picker is opened. In this case, at the time of opening, the picker would not have a value. And, by design, the view would be the one which contains the "today" date. It is important to point out that only once the default view would be opened. If you navigate to the next month, close and reopen the picker, the next month would be in the view. 

If you would like to change the behavior of the picker when the value is null and the view which shows, you can use its API. And more specifically, the navigate() method. More information could be found here:

https://docs.telerik.com/kendo-ui/api/javascript/ui/calendar/methods/navigate

Let me know in case further clarifications are needed.


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.