node-parse-iso-duration
Parse an ISO 8601 duration to milliseconds
Instalation
npm install --save parse-iso-duration
Usage
var parseIsoDuration = ; ; // 8 * 1000; // 10 * 60 * 1000; // 20 * 60 * 60 * 1000; // 6 * 60 * 1000 + 4 * 1000 ; // Throws "Invalid duration"; // Throws "Ambiguous duration"
Year and month
If years or months is specified and more than 0 the library will throw "Ambiguous duration"
since it's meaning can't be converted to milliseconds.
License
MIT