Unplanned
Last Updated: 11 Dec 2021 09:49 by ADMIN
Created by: Doug
Comments: 3
Category: DateTimePicker
Type: Feature Request
14

With Blazor server, clicking the NOW button (obviously) sets the time to the time on the server since that's where the code is running. Is there a way to trap the NOW button click or somehow give it an offset or define the value that NOW means so NOW will mean the time that the user is sitting in?

---

ADMIN EDIT

One way this could land could be through templates for the header areas of the calendars - that would let you put your own NOW button there so you can handle its click and change the value as desired. So, you may want to follow and/or Vote for this approach here: https://feedback.telerik.com/blazor/1468855-header-template-for-the-calendars.

A workaround for the time being could be hiding the Now button with some CSS:

<style>
    .no-now-button .k-time-now {
        display: none;
    }
</style>

Selected time: @selectedTime
<br />

<TelerikDateTimePicker PopupClass="no-now-button"
                       Min="@Min" Max="@Max" @bind-Value="@selectedTime"
                       Format="dd MMM yyyy HH:mm:ss" Width="250px"></TelerikDateTimePicker>

@code {
    private DateTime? selectedTime = DateTime.Now;
    public DateTime Min = new DateTime(1990, 1, 1, 8, 15, 0);
    public DateTime Max = new DateTime(2025, 1, 1, 19, 30, 45);
}

---

Unplanned
Last Updated: 29 Mar 2024 10:46 by Austin

Hi.

When entering an invalid date in a DateTimePicker, the component will automatically revert the entered value back to its previous valid value.

I didn't expect this because the user may type in an invalid date, and continue to the next input control within the form, and not notice the error that was briefly displayed.

The issue can be reproduced in the DateTimePicker Demo here: https://demos.telerik.com/blazor-ui/datetimepicker/validation

Steps to reproduce:

1. Click in the day part of the date.

2. Enter 13

3. Enter 2100

4. Press the Tab key

5. Notice the date is automatically reverted (back) to 10/13/2019.

 

I expected the date to be set to 10/13/2100 with the input validation errors visible to the user after pressing the Tab key in step 4.

 

I've categorized this issue as a bug because otherwise, the form can be submitted with a value that the user did not enter.

 

If this behavior cannot be changed from being the default behavior, then there should be an option to prevent this behavior from happening.

 

Thank you.

Unplanned
Last Updated: 18 Oct 2024 08:00 by ADMIN
Created by: Grant
Comments: 2
Category: DateTimePicker
Type: Feature Request
5
I have a case where I need the users to be able to change the date and time, but most will just be editing the time? Is there a way to default open to the Time Page rather than opening the Date page every time?
Unplanned
Last Updated: 21 Jun 2021 11:22 by ADMIN
Created by: n/a
Comments: 0
Category: DateTimePicker
Type: Feature Request
4

I'd like to have the ability to disable dates and times.

Just an idea would be awesome to Add a object with a max and min properties which you can pass as a collection to the component.

Based on the current way how max and min work, but it disables ranges between each min and max of each object in that collection.
Unplanned
Last Updated: 08 Aug 2024 15:30 by Twain

The input in the DateTimePicker is valid when:

- the DateTimePicker value is bound to nullable DateTime and

- the user clears the input

In such cases, the input field shouldn't get a red border.

Here is a REPL example to reproduce the issue:

  1. Select a date.
  2. Clear the date. The input gets a red border.

===ADMIN EDIT===

A possible workaround is to change the border color with CSS. Here is a REPL example.


Unplanned
Last Updated: 12 Jul 2024 07:05 by ADMIN

If you are zooming a page containing a DateTimePicker with "AdaptiveMode" set to "AdaptiveMode.Auto", the application crashes occasionally with the error:

Microsoft.JSInterop.JSException: Cannot read properties of null (reading 'addEventListener')
TypeError: Cannot read properties of null (reading 'addEventListener')

The more adaptive DateTimePicker instances the page contains, the more likely the error is to occur.

 

 

Unplanned
Last Updated: 08 Feb 2023 12:20 by Yanislav
Created by: Martin Herløv
Comments: 1
Category: DateTimePicker
Type: Bug Report
3

DateTimePicker loses focus when the NOW button is clicked. 

To reproduce the problem open the following demo:

https://demos.telerik.com/blazor-ui/datetimepicker/overview

Try clicking a few times on the NOW button. The focus is occasionally lost. 

https://www.screencast.com/t/BPEXTy43

 

 

 

 

 

Unplanned
Last Updated: 06 Jun 2023 12:39 by ADMIN
Created by: Stewart
Comments: 5
Category: DateTimePicker
Type: Feature Request
2

Hi,

I have a REPL showing the issue.

I am using DataAnnotation where possible in my application and I was expecting the DisplayFormat attribute to be applied in the DateTimePicker like it is for DatePicker but as shown in the REPL link below it's not. I will use a workaround of applying the Format attribute everywhere but I would appreciate this being changed.

https://blazorrepl.telerik.com/GdkpcclE28sZ9VZH54

Unplanned
Last Updated: 08 Jul 2021 08:47 by ADMIN
The Set button should not be enabled when you change the month from the button in the popup, until the user selects a date too. 
Unplanned
Last Updated: 02 Feb 2021 17:54 by ADMIN

Based on the example https://demos.telerik.com/blazor-ui/datetimepicker/overview, on Cancel or Set, the Input gets focused. On the mobile, it causes the keyboard to appear as well, which is not an intuitive behaviour.

Is it possible for this behaviour to be removed?

---

ADMIN EDIT

This behavior is OS specific, in our tests iOS does not exhibit it. It is generally up to the OS to show the soft keyboard and the web app should not be able to alter that.

Also, generally speaking from an accessibility point of view, popups must have a default focus (we do that), and when they close, they must return the user to the flow of the application in the place where they took it from. In this case, that's an interaction with the picker component.

Nevertheless, if the focus went to the button rather than the input, it is highly likely that the behavior would be resolved. The only downside would be that Android users will need a second action to get the focus back in the input.

---

Unplanned
Last Updated: 15 Jun 2020 15:30 by ADMIN
Created by: const
Comments: 0
Category: DateTimePicker
Type: Bug Report
2

I want the user to only be able to select times between, for example, 11AM and 1PM. Setting Min and Max does not limit that, I can select any time:

Selected time: @selectedTime
<br />

<TelerikDateTimePicker Min="@Min" Max="@Max" @bind-Value="@selectedTime"
                       Format="dd MMM yyyy HH:mm" Width="250px"></TelerikDateTimePicker>

@code {
    private DateTime? selectedTime = DateTime.Now;
    public DateTime Min = new DateTime(2020, 6, 11, 10, 15, 0);
    public DateTime Max = new DateTime(2020, 6, 13, 12, 30, 45);
}
Unplanned
Last Updated: 15 Nov 2024 13:23 by ADMIN
Scheduled for 2024 Q4 (Nov)

The bug is reproducible only when the TimePicker is bound to a nullable type (be that DateTime or TimeOnly). In this case, selecting time from the popup includes seconds in the value - the seconds from the time of selection. When typing in the input, seconds are always 00.

The issue is that the user is not aware of the seconds' value and cannot change it. This may lead to a variety of problems - e.g. filtering by time in Grid: https://blazorrepl.telerik.com/cebaGNlH53mOoiaA12.

Unplanned
Last Updated: 04 Nov 2024 07:44 by ADMIN
In our serverside blazor application we use the Telerik's DateTimePicker. When we type values in to the date time picker control, it jumps to the next section or to the end before completing the currect section. We use the format 'yyyy-MM-dd HH:mm'

It does not happen always and I think it is happenning when the internet connection is slow and it shows a Javascript error as well (screenshots below)
Unplanned
Last Updated: 18 Sep 2023 09:08 by Richard

When the component's Adaptive mode is set to Auto, the Date & Time buttons in the popup are not rendered. 

<AdminEdit>

Here is a CSS workaround that hides the titlebar in adaptive mode so that the buttons are present:

<style>
    .k-actionsheet-titlebar.k-text-center{
        display: none;
    }
</style>

<TelerikDateTimePicker @bind-Value="@SelectedTime"
                        Format="MM/dd/yyyy hh:ss"
                        ShowWeekNumbers="true"
                        Id="selected-date"
                        AdaptiveMode="Telerik.Blazor.AdaptiveMode.Auto">
</TelerikDateTimePicker>

@code {
    private DateTime? SelectedTime = DateTime.Now;
}

</AdminEdit>

Unplanned
Last Updated: 06 Dec 2021 15:02 by ADMIN
Created by: NovaStor
Comments: 0
Category: DateTimePicker
Type: Feature Request
1

I can't type AM or PM in the DateTimePicker to explicitly change to AM or PM.

For example:

1. Go to https://demos.telerik.com/blazor-ui/datetimepicker/overview.

2. Click on AM or PM in the DateTimePicker field.

3. Try to type "AM" or "PM".

4. If the time is "AM", notice that typing "PM" does not change "AM" to "PM", and visa-versa.

This causes our UI tests to fail when entering a date that has a different meridian time than the current time.

I expected the same behavior as the UI for ASP.NET Core: https://demos.telerik.com/aspnet-core/datetimepicker.

----------ADMIN EDIT----------

In the meantime, you can achieve the desired functionality by following the steps from the knowledge base article below.

Select AM/PM by pressing A or P on the keyboard - KB

Unplanned
Last Updated: 08 Jul 2021 09:08 by ADMIN
Created by: Grant
Comments: 0
Category: DateTimePicker
Type: Feature Request
1

 I want to to be able to catch the click of the Set button regardless of whether or not the value was changed.

 

==========

ADMIN EDIT

==========

For the time being, a possible workaround could be to use some JS Interop to catch the click of the Set button. You can create a custom OnOpen event for the DateTimePicker dropdown as per the admin edit example in this post. You can use the OnOpenHandler to invoke the JS responsible for catching the click event of the Set button. The example below demonstrates the described approach.

@inject IJSRuntime JSInterop

Selected time: @selectedTime
<br />
<span class="datetimepicker-span" @onclick="@OnOpenHandler">
    <TelerikDateTimePicker Min="@Min" Max="@Max" @bind-Value="@selectedTime"
                           Format="dd MMM yyyy HH:mm:ss" Width="250px">       
    </TelerikDateTimePicker>
</span>

@code {

    public bool isOpened { get; set; } = false;

    public async Task OnOpenHandler()
    {
        isOpened = !isOpened;

        if (isOpened)
        {            
            await JSInterop.InvokeVoidAsync("SetBtnClicked", ".k-time-accept");

            isOpened = false;
        }        
    }    

    private DateTime? selectedTime = DateTime.Now;
    public DateTime Min = new DateTime(1990, 1, 1, 8, 15, 0);
    public DateTime Max = new DateTime(2025, 1, 1, 19, 30, 45);

}

 

    <script>
        function SetBtnClicked(selector) {
            var element = document.querySelector(selector);
            element.addEventListener('click', function () {
                alert("Set button clicked");
            });
        }
    </script>