[PR #394] [MERGED] DatePicker: Added support for DateTime Min and Max. #2171

Open
opened 2026-01-29 18:17:33 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/radzenhq/radzen-blazor/pull/394
Author: @MarcelRoozekrans
Created: 3/10/2022
Status: Merged
Merged: 3/14/2022
Merged by: @enchev

Base: masterHead: feature/Add-DateTime-Min-and-Max-support


📝 Commits (1)

  • 7c08ef6 DatePicker: Added support for DateTime Min and Max.

📊 Changes

3 files changed (+46 additions, -11 deletions)

View changed files

📝 Radzen.Blazor.Tests/DatePickerTests.cs (+38 -2)
📝 Radzen.Blazor/RadzenDatePicker.razor (+7 -2)
📝 Radzen.Blazor/RadzenDatePicker.razor.cs (+1 -7)

📄 Description

This is a fix for a bug I encountered when using the DatePicker control.

When the date is a DateTime.MaxValue the control throws a n exception:

   at System.DateTime.ThrowDateArithmetic(Int32 param)
   at System.DateTime.AddTicks(Int64 value)
   at Radzen.Blazor.RadzenDatePicker`1.BuildRenderTree(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)```

---

<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
## 📋 Pull Request Information **Original PR:** https://github.com/radzenhq/radzen-blazor/pull/394 **Author:** [@MarcelRoozekrans](https://github.com/MarcelRoozekrans) **Created:** 3/10/2022 **Status:** ✅ Merged **Merged:** 3/14/2022 **Merged by:** [@enchev](https://github.com/enchev) **Base:** `master` ← **Head:** `feature/Add-DateTime-Min-and-Max-support` --- ### 📝 Commits (1) - [`7c08ef6`](https://github.com/radzenhq/radzen-blazor/commit/7c08ef6e637b1813c8145c49b4de85651fcc11fb) DatePicker: Added support for DateTime Min and Max. ### 📊 Changes **3 files changed** (+46 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `Radzen.Blazor.Tests/DatePickerTests.cs` (+38 -2) 📝 `Radzen.Blazor/RadzenDatePicker.razor` (+7 -2) 📝 `Radzen.Blazor/RadzenDatePicker.razor.cs` (+1 -7) </details> ### 📄 Description This is a fix for a bug I encountered when using the DatePicker control. When the date is a DateTime.MaxValue the control throws a n exception: ```Error: System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'value') at System.DateTime.ThrowDateArithmetic(Int32 param) at System.DateTime.AddTicks(Int64 value) at Radzen.Blazor.RadzenDatePicker`1.BuildRenderTree(RenderTreeBuilder __builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 18:17:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#2171