Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 1.13 KB

readme.md

File metadata and controls

48 lines (39 loc) · 1.13 KB

💬 📅 Sooner or Later

Parse natural language dates

minified and gzipped size minified size zero dependencies

Install

npm add soonerorlater

Examples

import { parse } from "soonerorlater";

parse('Every Wednesday');
/*
{
  repeats: 'weekly',
  weekdays: new Set(['wednesday'])
}
*/

parse('Mondays and Thursdays at 9:30am to 10:30am');
/*
{
  repeats: 'weekly',
  weekdays: new Set(['monday', 'thursday']),
  startTime: { hours: 9, minutes: 30 },
  endTime: { hours: 10, minutes: 30 }
}
*/

Notes

  • Uses the library parcook for parsing.
  • TODO: support standard representations as result