parse-relative-time
v1.1.0
Published
Parse simple relative time in human readable format to milliseconds.
Downloads
115
Readme
parseRelativeTime
Parse simple relative time in human readable format to milliseconds.
Documentation
parseRelativeTime
Parse simple relative time in human readable format to milliseconds.
Parameters
input
string Human readable format of relative time
Examples
parseRelativeTime('2 days'); // --> 172800000
parseRelativeTime('-2 days');
parseRelativeTime('in 2 days');
parseRelativeTime('2 days ago');
Returns (null | number)
Bug reports, feature requests and contact
If you found any bugs, if you have feature requests or any questions, please, either file an issue at GitHub or send me an e-mail at [email protected].
License
parseRelativeTime is published under the MIT license.