MudBlazor icon indicating copy to clipboard operation
MudBlazor copied to clipboard

MudDatePicker: Fix Display of Min and Max Date and MaxValue Crash

Open mckaragoz opened this issue 2 years ago • 5 comments

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

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

https://user-images.githubusercontent.com/78308169/156442334-5996283b-8f04-4106-aaf5-8315e689ca40.mp4

Checklist:

  • [x] The PR is submitted to the correct branch (dev).
  • [x] My code follows the code style of this project.
  • [ ] I've added relevant tests.

mckaragoz avatar Mar 02 '22 20:03 mckaragoz

Codecov Report

Merging #4088 (044c600) into dev (dd2b8c1) will decrease coverage by 0.08%. The diff coverage is 84.74%.

@@            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     
Impacted Files Coverage Δ
...c/MudBlazor/Components/DatePicker/MudDatePicker.cs 87.59% <50.00%> (-0.60%) :arrow_down:
...r/Components/DatePicker/MudBaseDatePicker.razor.cs 86.03% <83.33%> (-0.90%) :arrow_down:
...azor/Components/DatePicker/MudBaseDatePicker.razor 97.77% <100.00%> (ø)
...c/MudBlazor/Components/Popover/MudPopover.razor.cs 85.00% <0.00%> (-15.00%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dd2b8c1...044c600. Read the comment docs.

codecov[bot] avatar Mar 02 '22 20:03 codecov[bot]

So here the last news:

  • [x] Only years which between min and max show
  • [x] Year navigate button disappear in month view if they not inside min and max
  • [x] Mont navigate button disappear in day view if they not inside min and max

@JonBunator i added to show/hide buttons related to min max date, thats a great suggestion.

https://user-images.githubusercontent.com/78308169/159773266-ebdccaa9-f741-40dc-8e9b-a6dff1947fb7.mp4

If its done, i will prepare tests and then merge.

mckaragoz avatar Mar 23 '22 18:03 mckaragoz

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.

Ekran görüntüsü 2022-03-24 174405

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

https://user-images.githubusercontent.com/78308169/159942752-3a8ff8d5-f227-49c7-83bf-d62c839258db.mp4

And 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)

https://user-images.githubusercontent.com/78308169/159943209-3945b987-6e6b-49e6-9beb-52c2367bfc03.mp4

So if its good, there are only tests missing.

mckaragoz avatar Mar 24 '22 14:03 mckaragoz

Hi @mckaragoz Will you complete this or should we close.?

mikes-gh avatar Dec 19 '22 22:12 mikes-gh

Hi @mckaragoz Will you complete this or should we close.?

This one is nearly ready, i can do the remainings in this week

mckaragoz avatar Dec 20 '22 06:12 mckaragoz