JavaScriptRegenerated/yieldparser

Add example to parse natural time periods

Closed this issue · 1 comments

See:

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();