Format Appointment Times
This commit is contained in:
@@ -83,6 +83,36 @@ public class AppointmentDialogController {
|
||||
|
||||
cbMinute.getItems().addAll(0, 15, 30, 45);
|
||||
|
||||
cbHour.setCellFactory(param -> new ListCell<>() {
|
||||
@Override
|
||||
protected void updateItem(Integer option, boolean empty) {
|
||||
super.updateItem(option, empty);
|
||||
setText(empty || option == null ? null : String.valueOf(option));
|
||||
}
|
||||
});
|
||||
cbHour.setButtonCell(new ListCell<>() {
|
||||
@Override
|
||||
protected void updateItem(Integer option, boolean empty) {
|
||||
super.updateItem(option, empty);
|
||||
setText(empty || option == null ? null : String.valueOf(option));
|
||||
}
|
||||
});
|
||||
|
||||
cbMinute.setCellFactory(param -> new ListCell<>() {
|
||||
@Override
|
||||
protected void updateItem(Integer option, boolean empty) {
|
||||
super.updateItem(option, empty);
|
||||
setText(empty || option == null ? null : String.format("%02d", option));
|
||||
}
|
||||
});
|
||||
cbMinute.setButtonCell(new ListCell<>() {
|
||||
@Override
|
||||
protected void updateItem(Integer option, boolean empty) {
|
||||
super.updateItem(option, empty);
|
||||
setText(empty || option == null ? null : String.format("%02d", option));
|
||||
}
|
||||
});
|
||||
|
||||
cbService.setCellFactory(param -> new ListCell<>() {
|
||||
@Override
|
||||
protected void updateItem(DropdownOption option, boolean empty) {
|
||||
|
||||
Reference in New Issue
Block a user