Format Appointment Times

This commit is contained in:
2026-04-09 17:29:18 -06:00
parent fe7e81986d
commit 3631201435
2 changed files with 37 additions and 4 deletions

View File

@@ -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) {