Open neildaniels opened 5 years ago
Why would you expect only the month portion to show the null
value? It makes sense to me that if you deselect one part of the date, you want the whole field to be deselected. Otherwise you would select an actual other month. In that way, the field also guarantees that its value is either none (null
) or a valid actual state - not any invalid state.
Ah, that's very fair. I didn't consider the case where you want to actually deselect a date.
I guess it was weird to me that if you decide to reset one value, none of the other fields make any attempt to remember what they had stored in them in you "restore" the original value. They just always get reset to the "current" date.
For example, if you started with
2008
- 07
- 23
Then change the month value to —
.
I would expect that 2008
and 22
are remembered if I decide to re-select a month value.
But if you now select month 04
, it shows
2019
- 04
- 02
(assuming today was 2019-05-02)
I would have expected to be
2008
- 04
- 23
Here's a mockup of that, if it was decided that this behavior should be made clear to the user. (But does admittedly give the impression that partial dates would be saved.) This mockup's values don't match my "story," but illustrates what I'm thinking.
I wouldn't expect these values to persist across Panel refreshes (because, as you said, it doesn't make sense to save partial dates). But keeping it retained for those cases where you accidentally select —
instead of 01
this would be really handy.
To be honest, this seems like a huge effort (implementation, where to store such remembered previous values, etc.) for very little benefit. However, just my opinion - others might differ. I am moving this to the idea repo as it is no bug and maybe others can upvote on this, if they also feel like you that this would be beneficial.
Describe the bug If you load a page in the Panel that has a date field, if you change any one part of the field to "—" the entire field shows "—".
To Reproduce Steps to reproduce the behavior:
date
field a value already presentExpected behavior Only the month portion should show "—".
Screenshots
Kirby Version
3.1.3
Desktop (please complete the following information):