- Published on
Chrono: Natural Language Date Parser in JavaScript
- Authors
- Name
- Ashik Nesin
- @AshikNesin
If you want to parse natural language-based date string to date then Chrono might be a good choice for you.
With this library, you can parse date from various formats like this:
- Yesterday
- 2 days ago
- 2 weeks from now
- Remind me on Jun 10 4pm IST
- ... Refer their README for more
Dependency
npm i chrono-node
Snippet
import * as chrono from 'chrono-node';
// If you prefer CommonJS 👇
// const chrono = require('chrono-node');
chrono.parseDate('Remind me on Jun 10 4pm IST') // 2023-06-10T10:30:00.000Z
Happy parsing date!