RadzenDatePicker allows future dates and times to be chosen when Max is set #951

Closed
opened 2026-01-29 17:46:48 +00:00 by claunia · 0 comments
Owner

Originally created by @fieldsj23 on GitHub (Aug 9, 2023).

Describe the bug
Using RadzenDatePicker with a Max date set and ShowTime set to true, it is possible to choose dates in the future of the Max date set.

To Reproduce
Steps to reproduce the behavior:
Scenario 1:

  1. Go to https://blazor.radzen.com/datepicker
  2. Scroll down to the "Set Min and Max dates" example
  3. Update the code to include ShowTime="true"
    <RadzenDatePicker @bind-Value=@value Min="DateTime.Today.AddDays(-7)" Max="DateTime.Today.AddDays(7)" ShowTime="true" />
  4. Run the code
  5. Click the calendar icon and select a future month.
  6. Click ok.
  7. The date time is accepted

Scenario 2:
Follow the above steps through Step 4
5. Click the calendar icon and set the time for a future time
6. Click ok.
7. The date time is accepted

Expected behavior
Future months in the Max year should not be available and it should not be possible to increase past the Max time on the Max date.

Screenshots
Calendar as is when opened
image

Calendar allowing selection of a month and time in the future of the Max
image

Resulting time selected:
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome Version 115.0.5790.171 (Official Build) (64-bit)
    Edge Version 115.0.1901.188 (Official build) (64-bit)

Additional context

Originally created by @fieldsj23 on GitHub (Aug 9, 2023). **Describe the bug** Using RadzenDatePicker with a Max date set and ShowTime set to true, it is possible to choose dates in the future of the Max date set. **To Reproduce** Steps to reproduce the behavior: Scenario 1: 1. Go to https://blazor.radzen.com/datepicker 2. Scroll down to the "Set Min and Max dates" example 3. Update the code to include ShowTime="true" <RadzenDatePicker @bind-Value=@value Min="DateTime.Today.AddDays(-7)" Max="DateTime.Today.AddDays(7)" ShowTime="true" /> 4. Run the code 5. Click the calendar icon and select a future month. 6. Click ok. 7. The date time is accepted Scenario 2: Follow the above steps through Step 4 5. Click the calendar icon and set the time for a future time 6. Click ok. 7. The date time is accepted **Expected behavior** Future months in the Max year should not be available and it should not be possible to increase past the Max time on the Max date. **Screenshots** Calendar as is when opened ![image](https://github.com/radzenhq/radzen-blazor/assets/133258881/bf152dc9-b012-4b18-a8de-2e51f2e9964a) Calendar allowing selection of a month and time in the future of the Max ![image](https://github.com/radzenhq/radzen-blazor/assets/133258881/1345afb5-6348-4a27-b981-34df62b54d08) Resulting time selected: ![image](https://github.com/radzenhq/radzen-blazor/assets/133258881/20867c11-9683-4cdf-bcc1-cf54347cea9c) **Desktop (please complete the following information):** - OS: Windows 10 - Browser Chrome Version 115.0.5790.171 (Official Build) (64-bit) Edge Version 115.0.1901.188 (Official build) (64-bit) **Additional context**
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#951