Skip to content

Latest commit

 

History

History
45 lines (25 loc) · 1.11 KB

README.md

File metadata and controls

45 lines (25 loc) · 1.11 KB

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