Skip to content

Commit 9733241

Browse files
committed
Change the datepicker value according to the date of the inquired monitoring record
1 parent 8302bb6 commit 9733241

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/java/root/javafx/Controller/MonitoringAPController.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,18 @@ public void syncTableData(String id, int index) {
283283
List<T> tableData = data.get(new ArrayList<>(data.keySet()).get(index));
284284
tableViewContainer.setTableData(clazz, tableData);
285285

286-
// Sync monitoring prequency UI
287-
syncPrequency(prequencyTimeDivBtn.getText());
288-
289286
// Sync history monitoring datetime
290287
if (tableData != null && !tableData.isEmpty()) {
291288
String monitoringDateTime = tableData.get(0).getMonitoringDateTime();
292289
historyDateTimeLabel.setText(DateUtils.convertDateFormat("yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss",
293290
monitoringDateTime, Locale.KOREA));
291+
292+
// Set datepicker value
293+
inquiryDatePicker.setValue(LocalDate.parse(monitoringDateTime, DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
294+
295+
// Sync monitoring prequency UI
296+
syncPrequency(prequencyTimeDivBtn.getText());
297+
294298
} else {
295299
historyDateTimeLabel.setText(MONITORING_HISTORY_DEFAULT_TEXT);
296300
}
@@ -375,6 +379,7 @@ private Map<String, List<T>> inquiryMonitoringHistory(int type) {
375379
if(current.equals(MONITORING_HISTORY_DEFAULT_TEXT)) {
376380
return null;
377381
}
382+
378383
String currentDateTime = DateUtils.convertDateFormat("yyyy-MM-dd HH:mm:ss", "yyyyMMddHHmmss", current,
379384
Locale.KOREA);
380385
if (type == -1) {

0 commit comments

Comments
 (0)