havit / Havit.Blazor

Free Bootstrap 5 components for ASP.NET Blazor + optional enterprise-level stack for Blazor development (gRPC code-first, layered architecture, localization, auth, ...)
https://havit.blazor.eu
MIT License
486 stars 67 forks source link

[HxInputDate] - When selected date year is out of the MinDate-MaxDate, year is not displayed #794

Open jirikanda opened 5 months ago

jirikanda commented 5 months ago

https://github.com/havit/Havit.Blazor/assets/5111719/4606465b-b556-4f60-babf-bcfb30184e17

hakenr commented 5 months ago

@jirikanda @crdo What do we expect the component to do?

jirikanda commented 5 months ago

throw an exception on invalid parameters?

From my perspective, everything is valid.

hakenr commented 5 months ago

throw an exception on invalid parameters?

From my perspective, everything is valid.

  • User (in the past) entered some value which is saved in the database.
  • We are showing user's value and let the user fix the value to the current min-max date range.

Not entirely sure, but you are probably right.

The current documentation/specification states "The first/last date selectable from the dropdown calendar." for the MinValue/MaxValue parameters. We could allow the Value to be outside these bounds, but the dropdown calendar will still only allow selections within the MinDate..MaxDate range (as far as I know, we don't use these boundaries for validation; it's up to the user to validate the value in the model). So technically, we can open a calendar dropdown for the month of the currently selected value, but still with "disabled" values (strikethrough).