Git Product home page Git Product logo

durationjs's People

Contributors

birdwell avatar desimone avatar evanisnor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

durationjs's Issues

package.json file

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.

npm

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.

Tests fail

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

Simple examples

Ideas

  • Enter flight numbers, determine time until boarding, takeoff, and landing. I think this would be a great use of TZ.
  • Movie / TV show / etc countdown.

Cannot handle fractions of a second (and potentially other fractions)

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”.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.