DatePicker defaults to 00:00 am - has this changed in recent versions?

1 Answer 52 Views
Date/Time Pickers
Brian
Top achievements
Rank 1
Brian asked on 22 Aug 2024, 09:33 PM | edited on 22 Aug 2024, 09:34 PM

I've got a vexing problem with this inherited code base.

The application has dozens of reports. Each report has two datepickers, StartDate and EndDate. 

As part of a company-wide migration, we're upgrading all of our projects to the latest frameworks and nuget packages. I did that with this application. I'm now using Telerik UI for ASPNET Core 2024.2.514. The previous version was 2020.1.114. 

While in test, the users are reporting that numbers are off from what's in production. Before, if they entered an end date of 7/1/2024, the Value that got passed into the query was inclusive of everything that happened on 7/1. In the current version, it looks like the Value is non-inclusive, so end date is 7/1/2024 00:00:00. 

The only thing I've done to the application is upgrade these packages, and the only thing that affects these date ranges was upgrading the Telerik UI.

So - first things first - does a datepicker (not datetimepicker) ALWAYS default to 00:00:00 as the time portion? Across these versions?

Thanks for any info. Let me know if there's any other info I can provide. 

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 27 Aug 2024, 10:15 AM

Hello Brian,

Thank you for the details provided.

The Telerik UI Components are wrappers of the Kendo UI Widgets and are responsible for visualizing the provided data.

The EndDate, in this case, is a DateTime-typed property whose value is not set by the Telerik UI DateTimePicker, but from the Controller and the setter of the property. If you need to include the date selected as the end date, I would recommend adding logic in the setter of the property that changes the time portion to 23:59:59.

Give a try to the described approach and let me know if it achieves the desired result.

 

Kind Regards,
Anton Mironov
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

Brian
Top achievements
Rank 1
commented on 27 Aug 2024, 07:17 PM

Thank you. However, these are not being used to display data, they are being used to enter dates for a query. So with the datepicker, if they enter 8/27/2024 as an end date, the value being sent is 08-27-2024 00:00:00. This means that nothing that happened on that date displays. Apparently this works differently than the previous version, which used the old widgets. Also why I'm asking if anything about the widgets themselves changed.
Anton Mironov
Telerik team
commented on 30 Aug 2024, 05:28 AM

Hi Brian,

Thank you for the additional details provided. I am not sure if there is any extra script was used before as I can see the behavior with an old version and the last one. The Telerik UI Components are wrappers of the Kendo UI Widgets, so the result of the value in a DateTimePicker is always with time 00:00:00. Here are two dojos with different versions:

Feel free to run the above examples on your side and observe the result in the console of the browser.

 

Best Regards,
Anton Mironov

Tags
Date/Time Pickers
Asked by
Brian
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
Share this question
or