Skip to content
Adds xs:duration to dateTime
JavaScript Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
Makefile
README.md
bower.json
package.json
xsduration-0.0.2.min.js
xsduration.js

README.md

build status

xsdurationjs

A w3c adding duration to datetime implementation for node and the browser with no dependencies.

node.js:

// Install
$ npm install xsdurationjs

// Require
var xsduration = require('xsdurationjs');

Browser:

Traditional way

Download xsduration-0.0.2.min.js to your scripts directory and include it with a script tag.

<script type="text/javascript" src="/js/xsduration-0.0.2.min.js"></script>

It does not have any dependency.

Bower

$ bower install xsduration

synopsis

// Add five months
var r = xsduration.add('P5M', new Date(2012,0,1);

// Add five years and five months
var r = xsduration.add('P5Y5M', new Date(2012,0,1);

License

MIT. See LICENSE file.

Bitdeli Badge

Something went wrong with that request. Please try again.