The Date API extracted from the excellent Sugar library.
Sugar's date parsing, particularly the natural language processing, is second to none in the JavaScript world. This module exposes Sugar's Date API, for node and the browser, stripping away the rest of the library.
Install from npm:
npm install sugar-date
Require the module at the top of the entry point to your app:
require('sugar-date');
Install from bower:
bower install sugarjs-date
Add a script tag to your index.html
file:
<script src="bower_components/sugar-date/sugar-date.js"></script>
Sugar augments the built-in Date
object. Check out the API docs for more details.
Please note that the .range()
method is not available. For more details, see this issue.