Unplanned
Last Updated: 12 Mar 2025 12:38 by Piotr
Piotr
Created on: 12 Mar 2025 12:38
Category: DateInput
Type: Bug Report
0
DateInput does not accept null as a valid value when using a standard date format string or a week day

This is a continuation of public item DatePicker, TimePicker and DateTimePicker should accept null value as valid when bound to nullable DateTime

The problem persist when:

  • The component Format includes a week day.
  • The component Format is set with a standard date format string (d, D, g, etc.)

Test page with workarounds:

Bug due to week day format string inconsistency between .NET and JavaScript (dddd vs EEEE):

<TelerikDateTimePicker @bind-Value="@SelectedTime"
                       ShowClearButton="true"
                       Width="360px">
    <DateTimePickerFormatPlaceholder Weekday="week" />
</TelerikDateTimePicker>

<br />
<br />

Bug due to usage of a standard date format string:

<TelerikDatePicker @bind-Value="@SelectedTime"
                   ShowClearButton="true"
                   Format="d"
                   Width="360px">
    <DateTimePickerFormatPlaceholder Day="dd" Month="mm" Year="yyyy" />
</TelerikDatePicker>

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

 

0 comments