Created
April 3, 2020 15:48
-
-
Save TomyCesaille/c6037e1e9cd99a9b53bbb6863b61a5a0 to your computer and use it in GitHub Desktop.
natural date parsing using chrono.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const chrono = require('chrono-node'); | |
// ... | |
let status = await statusElt.evaluate(x => x.textContent); // `last seen today at 13:15` format. | |
let lastSeenDate = chrono.parseDate(status); | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment