DatePicker with custom footer and time bug

Hello, I'm using a DatePicker with a custom footer to easily select the current date and time, identical to the "DatePicker with custom footer" found in the Blazor DatePicker Component site and it works correctly.

Then I added the time visualization with "ShowTime="true"" I notice the following bug, which I can easily reproduce on the Radzen Blazor Components site too.

Steps to reproduce:

  • Set date and time different from the current date and time (for example yesterday at the same time - 10 minutes)
  • Open DatePicker, press today button and see that the date and time are set to the current date and time, both in the label and in the DatePicker itself
  • Press ok button and see that the date is set correctly as the current date but the time is set as before pressing the today button (-10 minutes)

My whole code is the same as the "DatePicker with custom footer" just with ShowTime set to true. Adding "ShowTime="true"" to the online example from Radzen Blazor Components site shows the same issue.

Whole code:

<div class="rz-p-12 rz-text-align-center">
    <RadzenLabel Text="Select Date" Component="DatePickerFooterTemplate" Style="margin-right: 8px; vertical-align: middle;" />
    <RadzenDatePicker @bind-Value=@value Name="DatePickerFooterTemplate" ShowTime="true">
        <FooterTemplate>
            <RadzenButton Click=@(args => value = DateTime.Now) Text="Today" class="my-3 w-100" />
        </FooterTemplate>
    </RadzenDatePicker>
</div>

@code {
    DateTime? value = DateTime.Now;
}

Thanks for the report @sv-ed! Indeed when Value is set, time should respect the new value. We will do our best to include fix for this in one of our upcoming updates - we accept pull requests also!

1 Like