This is a migrated thread and some comments may be shown as answers.

Today-button includes time

5 Answers 92 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Magnus
Top achievements
Rank 1
Magnus asked on 27 Nov 2018, 11:13 AM
When using the Today-button to select todays date, the selected value also includes the current time. Not what I would expect for the DatePicker. We solve it easy at our end, but I thought you might want to now.

5 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 30 Nov 2018, 09:36 AM
Hi Magnus,

I double check this on my side but wasn't able to reproduce it. I have used the below code. 
<telerik:RadDatePicker TodayButtonVisibility="Visible" />
When I press the today button only a Date format is visible in the TextBox of the RadDatePicker. Can you elaborate more on your scenario? 

Regards,
Dinko
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.
0
Magnus
Top achievements
Rank 1
answered on 03 Dec 2018, 08:54 AM
Hi, sorry for not describing the issue better. The problem arise in a RadGridView where we have a column displaying dates. If I try to filter such a column and sets the date by the Today-button (not visible by default) I guess that the grid is using the SelectedValue property, and that property includes both time and date parts and is then trying to filter with both current date and time. I realize that that the SelectedValue should include both date and time, but I would expect that a click on "Today" should set the date to the current date, and the time to zero.
0
Dinko | Tech Support Engineer
Telerik team
answered on 05 Dec 2018, 12:59 PM
Hello Magnus,

Thank you for the provided details.

To achieve the desired result you will need to create a custom command that sets only the SelectedDate value when the Today button is clicked and replace the default telerik:RadDateTimePickerCommands.SetToday command with your command in the RadDateTimePicker's control template. You can refer to the Editing Control Templates article for more information.

Check the attached project. I am guessing that you are placing a RadDatetimePicker control in a CellTemplate of the RadGridView. You can add the modifications of the RadDateTimePicker demonstrated in the attached project in your main application.

Regards,
Dinko
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.
0
Dinko | Tech Support Engineer
Telerik team
answered on 05 Dec 2018, 01:23 PM
Hello Magnus,

As a follow-up. You can take a look at this forum thread where similar behavior was discussed. You can try the solution suggested from my colleague Martin which could be more appropriate in your scenario.

Regards,
Dinko
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.
0
Magnus
Top achievements
Rank 1
answered on 06 Dec 2018, 06:08 AM
Thanks.
Tags
DatePicker
Asked by
Magnus
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Magnus
Top achievements
Rank 1
Share this question
or