Duplicated
Last Updated: 27 May 2021 11:09 by ADMIN
Ardi
Created on: 26 May 2021 11:12
Category: UI for Blazor
Type: Feature Request
0
TelerikTimePicker Override or determine Action button clicks.
Hi,

I'd like to be have possibility to override <TelerikTimePicker /> buttons' actions or determine which button was clicked.
There's no built-in way to differentiate "Now" and "Set" button click on <TelerikTimePicker /> .

For example I'd like to be able to determine when "Now" button was clicked and modify the time accordingly (set different timezone offset for example). 

Kind regards,
Ardi Aver 
Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
4 comments
ADMIN
Marin Bratanov
Posted on: 27 May 2021 11:09

Indeed, Ardi, that's what I meant, sorry for not being clear enough.

--Marin

Ardi
Posted on: 27 May 2021 11:07
Edit for previous comment:
"Don't equal to 0"* 

Ardi
Posted on: 27 May 2021 11:04
Thanks for the reply, 
Unfortunately "Now" click doesn't allow for a direct comparison with DateTime.Now since it's always changing.
Thus I had to compare current time against the argument's hours and minutes and check if seconds and milliseconds equal to 0.

Regards,
Ardi

ADMIN
Marin Bratanov
Posted on: 27 May 2021 07:13

Hi Ardi,

There are three build-in buttons in the time picker and here is how you could tell their clicks apart through the ValueChanged event:

  • the Now button in the upper part - the argument the event handler will receive will be the current time so you can compare against that in the handler.
  • the Clear button at the bottom - the argument the handler will get is the default of the type (for example, null for a DateTime? type of Value) so you can check for that in the handler.
  • the Set button at the bottom - the argument will be a valid date that is neither the default, nor the current time.

So, a set of two if-else blocks in the ValueChanged handler will let you get that information.

This can let you take the current time the user is choosing, apply desired time zone settings (e.g., user profile settings) so you can store the data in the database accordingly (a common practice is to store in UTC and apply time zone differences in the data service according to user settings).

That said, there are two open feature requests that you might find useful for your scenario as well:

I've added your Vote on your behalf for both which raises their priority, and you can click the Follow button on them to get status email updates.

I am now going to mark this request as a duplicate to the one for a time zone, because that seems to be the main use case you have, and pointing all requests to a single page will keep the portal tidy.

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.