svoid test_parseEnglishDateRange() { Pair> p = test_parseEnglishDateRange_examples(); DateInterpretationConfig config = new(ukTimeZone(), parseYMDHMS(p.a), true); testFunctionValues(s -> { LongRange range = parseEnglishDateRange((S) s, config); ret range == null ? null : pair(formatDateWithSeconds(range.start, config.timeZone), formatDateWithSeconds(range.end, config.timeZone)); }, mapToParams(p.b)); } // returns (base date, examples) static Pair> test_parseEnglishDateRange_examples() { ret pair("2020/06/28 13:00:00", litorderedmap_withNulls( "", null, "anything else", null, "tuesday between 3 and 4 pm", pair("2020/06/30 15:00:00", "2020/06/30 16:00:00"), "2020/6/1 to 2020/6/3", pair("2020/06/01 00:00:00", "2020/06/04 00:00:00"), "june", pair("2020/06/01 00:00:00", "2020/07/01 00:00:00"), // assume Sunday-starting week "this week", pair("2020/06/28 00:00:00", "2020/07/05 00:00:00"), "next week", pair("2020/07/05 00:00:00", "2020/07/12 00:00:00"), )); }