Closed rzillmann closed 3 weeks ago
Just stumbled across the same problem with DatePicker, setValue does not set the Value in the field anymore. Checked it against a plain javafx Datepicker and there it gets displayed correctly
Sorry, I don't follow. There is indeed a bug in the calendar constructor, but it's not related to this issue.
If I instantiate a calendar with null value, getValue()
returns null and the skin only highlights today's (.today
) but not selected (.selected
) value.
If I instantiate a calendar with non-null value, it displayed correctly and getValue()
returns that value.
Just stumbled across the same problem with DatePicker, setValue does not set the Value in the field anymore. Checked it against a plain javafx Datepicker and there it gets displayed correctly
It's the same control. I created (copy-pasted, actually) the Calendar only because JavaFX doesn't export DatePickerContent
and inline date picker is kinda mandatory these days.
My bad you are absolutly right. I got bamboozled pretty good by the two blue tones and the fact i was working with today. Was totally not thinking of "thats a generic today marker" so my wording was bad. I would like to change this to a question:
What's the reason for not setting today as default instead of null? I can't even "unselect" if i clicked a date once
For example, when it comes to validation, it's important to know whether the user has selected something or not in order to provide more informative error messages. "You need to select a date" versus "Your date is greater than X". So, I think null value is really important here.
As for unselecting, that like pretty much everyone datepicker works 1, 2, 3. The Calendar supports two optional slots: top and bottom. You can put a unselect button here if you need to.
TickTick:
Trello:
True, thank you for the clarification
Hello, after using AtlantaFX it came to my attention that the Calendar does initiate the ui and the model differently which is kind of unintuitive and a little annoying. I think the displayed value and the underlying value should match.
Used theme: cupertino dark
Expected behaviour
If a Calendar is instantiated (code or via fxml) i want to see the current date ( if not stated otherwise) is displayed visualized in the component after the ui is displayed.
If i call getValue i want to get the current date
Actual behaviour The current date is displayed in the UI correctly getValue returns null
Ways to reproduce After instantiating a Calendar call getValue without setting the value before