Add example to parse natural time periods
Closed this issue · 1 comments
RoyalIcing commented
See:
- https://twitter.com/kentcdodds/status/1362596891460997124
- https://twitter.com/kentcdodds/status/1362602230298202117
const input = "Every Wednesday from 10:00am to 11:00am";
const result = parse(input, NaturalTimeSpan);
/*
{
"repeat": "weekly",
"weekdays": new Set(["Wednesday"]).
"startTime": "1000",
"endTime": "1100"
}
*/
const { value: nextDate } = future(result).next();
RoyalIcing commented
Solved with https://github.com/RoyalIcing/soonerorlater