ParseHumanDate.js
A Javascript library to parse human readable dates and times
Install / Use
/learn @benwasser/ParseHumanDate.jsREADME
ParseHumanDate.js
A Javascript library to parse human readable dates and times
See demo here.
This is basically an amalgamation of three existing human date/time parsers (datejs, chrono, and sugar). I found I needed to build this library because each of the existing ones has pretty big limitations and these three tend to compliment each others' strengths when combined.
Instructions
Include the script in your HTML:
<script src="ParseHumanDate.js"></script>
Call it on given text:
parseHumanDate('now');
>>> Sat Nov 22 2014 16:15:17 GMT-0500 (EST)
parseHumanDate('in an hour');
>>> Sat Nov 22 2014 17:15:17 GMT-0500 (EST)
parseHumanDate('next friday');
>>> Fri Nov 28 2014 12:00:00 GMT-0500 (EST)
parseHumanDate('tomorrow at 3');
>>> Sun Nov 23 2014 15:00:00 GMT-0500 (EST)
parseHumanDate('Dec 18 2am');
>>> Thu Dec 18 2014 02:00:00 GMT-0500 (EST)
parseHumanDate('jan 7');
>>> Wed Jan 07 2015 12:00:00 GMT-0500 (EST)
Known Issues
Doesn't do well with some English written-out numbers in certain syntaxes ('in ten minutes', 'twelve hours from now')
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
Security Score
Audited on Jul 3, 2020
