Open DJViking opened 7 years ago
That's right, it currently only allows you to pick the date and you have to write the time yourself. I did it like this because it's more convenient IMO. Picking the time just takes more time (pun intented), but for date you might need to consult a calendar. There is only one button, so this shouldn't be confusing, but I'd be up for adding a time picker in form of two spinners perhaps, if that's what you're envisioning?
Any feedback or sketch you can provide with regards to layout suggestions are most welcome :)
The project ControlsFX started with a TimePicker, but it did not make it. https://bitbucket.org/controlsfx/controlsfx/pull-requests/522/new-control-timepicker/diff
There is even a JDK feature request for a TimePicker. https://bugs.openjdk.java.net/browse/JDK-8090397 Java has LocalTime, LocalDate, LocalDateTime. It should definitely have JavaFX control for each of these.
The project JFoenix has a similar TimePicker implementation: https://github.com/jfoenixadmin/JFoenix
Such a similar TimePicker could be implemented as a second popup after choosing the date.
Certainly possible, but I think we're better off reimplementing the date picker to support grater freedom and control over the functionality and design. The DateTimePicker in it's current form is simply a hack around the stock DatePicker. I don't have time to look at this right now, but a PR would be most welcome :)
I would also look forward to a TimePicker!
The time picker could be implemented as sliders, perhaps something similar like the Android date time picker.
That design works on mobile but seems quite cumbersome to use on a desktop IMO.
Works fine with one small comment. Edit of the time gets lost if you re-pick the date. Think this would be solved for example by using the editor text string (or perhaps adding a commit ).
replace: time = localDateTime.toLocalTime(); with: time = LocalDateTime.parse(this.getEditor().getText(), formatter).toLocalTime();
The DateTimePicker does not have a TimePicker, just a DatePicker. The button opens the same calendar as the DatePicker.