Warning: session_start(): open(/var/lib/php/sessions/sess_ia3hjdvoao430nemp0gsvfn29e, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
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"),
));
}