From 7b85f5c3ef4c8d5bf26b7be952a85f4d7ed48636 Mon Sep 17 00:00:00 2001 From: Tim Bernhard Date: Sun, 1 Oct 2023 19:07:32 +0200 Subject: [PATCH] Fix one issue leading to compilation issues --- .../imagecapture/query/StringToDateQueryParser.java | 10 ++++++++++ .../harvard/mcz/imagecapture/ui/frame/MainFrame.java | 4 ---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/edu/harvard/mcz/imagecapture/query/StringToDateQueryParser.java b/src/main/java/edu/harvard/mcz/imagecapture/query/StringToDateQueryParser.java index cfd697a..62c2b60 100644 --- a/src/main/java/edu/harvard/mcz/imagecapture/query/StringToDateQueryParser.java +++ b/src/main/java/edu/harvard/mcz/imagecapture/query/StringToDateQueryParser.java @@ -61,10 +61,20 @@ public StringToDateQueryParser(String code) { LocalDate date = LocalDate.of(Integer.parseInt(m.group(1)), Integer.parseInt(m.group(2)), Integer.parseInt(m.group(3))); return new DateTuple(date); }); + put("(\\d{4})[/,\\.\\-]{1}(\\d{1,2})[/,\\.\\-]{1}(\\d{1,2}) ?\\- ?(\\d{4})[/,\\.\\-]{1}(\\d{1,2})[/,\\.\\-]{1}(\\d{1,2})", m -> { + LocalDate startDate = LocalDate.of(Integer.parseInt(m.group(1)), Integer.parseInt(m.group(2)), Integer.parseInt(m.group(3))); + LocalDate endDate = LocalDate.of(Integer.parseInt(m.group(4)), Integer.parseInt(m.group(5)), Integer.parseInt(m.group(6))); + return new DateTuple(startDate, endDate); + }); put("(\\d{1,2})[/,\\.\\-]{1}(\\d{1,2})[/,\\.\\-]{1}(\\d{4})", m -> { LocalDate date = LocalDate.of(Integer.parseInt(m.group(3)), Integer.parseInt(m.group(2)), Integer.parseInt(m.group(1))); return new DateTuple(date); }); + put("(\\d{1,2})[/,\\.\\-]{1}(\\d{1,2})[/,\\.\\-]{1}(\\d{4}) ?\\- ?(\\d{1,2})[/,\\.\\-]{1}(\\d{1,2})[/,\\.\\-]{1}(\\d{4})", m -> { + LocalDate startDate = LocalDate.of(Integer.parseInt(m.group(3)), Integer.parseInt(m.group(2)), Integer.parseInt(m.group(1))); + LocalDate endDate = LocalDate.of(Integer.parseInt(m.group(6)), Integer.parseInt(m.group(4)), Integer.parseInt(m.group(5))); + return new DateTuple(startDate, endDate); + }); }}; for (Map.Entry entry : regexers.entrySet()) { diff --git a/src/main/java/edu/harvard/mcz/imagecapture/ui/frame/MainFrame.java b/src/main/java/edu/harvard/mcz/imagecapture/ui/frame/MainFrame.java index 55d3dc4..674a933 100644 --- a/src/main/java/edu/harvard/mcz/imagecapture/ui/frame/MainFrame.java +++ b/src/main/java/edu/harvard/mcz/imagecapture/ui/frame/MainFrame.java @@ -926,10 +926,6 @@ public void adaptJpanelToSpecimenBrowser(SpecimenBrowser slb) { setStatusMessage("Found " + slb.getRowCount() + " matching specimens"); } - public void setSpecimenBrowseList(Specimen searchCriteria) { - this.setSpecimenBrowseList(searchCriteria, 0, 0); - } - /** * This method initializes jMenuItemBrowseSpecimens *