evanisnor / durationjs Goto Github PK
View Code? Open in Web Editor NEWA JavaScript library for parsing and manipulating ISO 8601 formatted duration strings.
License: MIT License
A JavaScript library for parsing and manipulating ISO 8601 formatted duration strings.
License: MIT License
It's difficult to know which (angular, testacular) dependencies are required for the project. Similar to PIP in python, you can use bower. It makes dep management easier for javascript.
Your package is called "durationjs" and has a version, but it doesn't seem to have been published to npm: https://npmjs.com/package/durationjs
Could you publish it please? Just run npm publish
in the directory.
http://cl.ly/image/2V0P1S2m0h2B
➜ durationjs git:(master) ✗ npm test
> [email protected] test /Users/bdd/Google Drive/Dropbox/projects/durationjs
> testacular start duration.testacular.conf.js
INFO [testacular]: Testacular server started at http://localhost:9876/
INFO [Chrome 25.0 (Mac)]: Connected on socket id 4Plia7JBy2am27rrWLhl
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) LOG: 'duration.js: Error: UNEXPECTED_FORMAT_ERROR'
Chrome 25.0 (Mac) Duration Test Suite Duration Formatted Getter Tests should return a valid ISO 8601 duration string FAILED
Expected '' to be 'P1Y1M1DT1H1M1S'.
Error: Expected '' to be 'P1Y1M1DT1H1M1S'.
at null.<anonymous> (/Users/bdd/Google Drive/Dropbox/projects/durationjs/test/duration.test.js:541:62)
Expected '' to be 'P56W'.
Error: Expected '' to be 'P56W'.
at null.<anonymous> (/Users/bdd/Google Drive/Dropbox/projects/durationjs/test/duration.test.js:542:67)
Expected '' to be 'P0001-01-01T01:01:01'.
Error: Expected '' to be 'P0001-01-01T01:01:01'.
at null.<anonymous> (/Users/bdd/Google Drive/Dropbox/projects/durationjs/test/duration.test.js:543:69)
Expected '' to be 'P00010101T010101'.
Error: Expected '' to be 'P00010101T010101'.
at null.<anonymous> (/Users/bdd/Google Drive/Dropbox/projects/durationjs/test/duration.test.js:544:72)
Chrome 25.0 (Mac): Executed 25 of 25 (1 FAILED) (0.428 secs / 0.382 secs)
WARN [Chrome 25.0 (Mac)]: Disconnected
Ideas
preferably MIT
http://www.tldrlegal.com/
If I get some free time I'll take a look at it myself.
should output 1h 2m with input PT3723.14159S:
Error: Unexpected duration format. Refer to ISO 8601.
at new Duration (node_modules/durationjs/js/duration.js:49:11)
Per Wikipedia (https://en.wikipedia.org/wiki/ISO_8601)
The smallest value used may also have a decimal fraction, as in “P0.5Y” to indicate half a year. This decimal fraction may be specified with either a comma or a full stop, as in “P0,5Y” or “P0.5Y”.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.