question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'DatePicker' component throws exception when low DateTimes are selected (close to DateTime.MinValue)

See original GitHub issue

Describe the bug

The ‘DatePicker’ component is throwing an exception when selecting a DateTime that represents the DateTime.MinValue (and other low values).

Steps to reproduce (please include code)

<DatePicker TValue="DateTime" Value=@DateTime.MinValue />

Simply clicking on top of the component to choose a date causes the below exception to be thrown.

Exceptions (if any)

System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'value') at System.DateTime.AddTicks(Int64 value) at System.DateTime.AddDays(Double value) at AntDesign.Internal.DatePickerDatePanel1.BuildRenderTree(RenderTreeBuilder __builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment) at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry) at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

Further technical details

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
anranruyecommented, Jun 17, 2021

@joaogoncalvesdev Thank you, now I understand what happened.

0reactions
anddrzejbcommented, Jun 20, 2021

@anranruye Are you working on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

DatePicker - The date of the threshold value directly results ...
When I use the following code, clicking the picker will throw an exception, which I think is unfriendly: Unhandled exception rendering ...
Read more >
wpf - Detect, whether an exception occured when using " ...
In the view model I have a property, that might throw an exception in the setter. Public Property DateValue As Nullable(Of Date) Get...
Read more >
[Solved] Remove min and max valu datetimepicker
The Windows DateTimePicker returns a DateTime value. DateTime values in C# value types hence cannot be null. Only reference Types can be null....
Read more >
I just can't figure this out. : r/csharp
The DateTimePicker defaults to MinDate of DateTime.MinValue because that's how the field is initialized. · You don't get an exception when you ...
Read more >
DxDateEdit<T> Class | Blazor
The DevExpress Date Edit for Blazor ( <DxDateEdit> ) displays a drop-down calendar that allows users to select dates. You can combine two...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found