MudDatePicker: Fix Display of Min and Max Date and MaxValue Crash#4088
MudDatePicker: Fix Display of Min and Max Date and MaxValue Crash#4088mckaragoz wants to merge 4 commits intoMudBlazor:devfrom
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (84.74%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #4088 +/- ##
==========================================
- Coverage 91.22% 91.13% -0.09%
==========================================
Files 359 359
Lines 12434 12482 +48
==========================================
+ Hits 11343 11376 +33
- Misses 1091 1106 +15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
JonBunator
left a comment
There was a problem hiding this comment.
In my opinion, it's way better UX if the buttons are either disabled or completely hidden (arrows).
It creates a false impression that something should happen when you get click feedback, but nothing happens.
|
So here the last news:
@JonBunator i added to show/hide buttons related to min max date, thats a great suggestion. 20220323_213659.mp4If its done, i will prepare tests and then merge. |
|
So here is the last news. I think its solid now. This is the last shape of when we reach MaxDate, next button disappears (same for the month view) and exceed days disabled. We have the reversed version for the MinDate. In current, DatePicker crashes when we try to go beyond to the max value, its fixed now. (Next button is hidden now, yes, but also fix the code so if there is even a button, it didn't give exception when you click it.) And also we hide buttons for the DateTime.MinValue and DateTime.MaxValue 20220324_172455.mp4And what about change date programmatically? Now we disabled that now date changing more than max and less then min have no effect. (This example shows that Min-Max picker value didn't changed although they are all connected by the same value) 20220324_173344.mp4So if its good, there are only tests missing. |
| } | ||
| } | ||
|
|
||
| :not(.mud-picker-hidden) { |
There was a problem hiding this comment.
@Garderoben i deleted this because prev button has not this kind of style and this !important prevents all visibility styling. We already fix the max date problem so i think this is not necessary. Could you look at this?
| return Culture.Calendar.GetDayOfMonth(date); | ||
| } | ||
|
|
||
| private void UpdateMinMaxDateExceedStatus() |
There was a problem hiding this comment.
@henon could you look at this? This method runs onafterrender(firstrender is true) and each time PickerMonth is changed. Is it simple enough?
There was a problem hiding this comment.
This is actually not a good way of doing it. Keeping state in private variables is always more error prone than just calculating that state. Instead you can add four private functions that calculate these states.
henon
left a comment
There was a problem hiding this comment.
Use calculated state instead of stored state. Then tests, then this can be merged.
| return Culture.Calendar.GetDayOfMonth(date); | ||
| } | ||
|
|
||
| private void UpdateMinMaxDateExceedStatus() |
There was a problem hiding this comment.
This is actually not a good way of doing it. Keeping state in private variables is always more error prone than just calculating that state. Instead you can add four private functions that calculate these states.
|
Hi @mckaragoz Will you complete this or should we close.? |
This one is nearly ready, i can do the remainings in this week |
|
@mckaragoz any intentions of reviving this or should this be closed? |
|
Wow does it still remain? I remembered that something was merged about max value. We should check |
|
The link provided in the issue still breaks, yeah. |
|
Hi, this pull request hasn't had activity in a while and has been marked as stale. Please reply if you're still working on it! |
|
Hi |

Description
Fixes #4087.
Fix min and max date to working properly on OpenTo.Month and OpenTo.Year.
How Has This Been Tested?
Types of changes
20220302_224304.mp4
Checklist:
dev).