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 *