functional-date-time-helpers
functional-date-time-helpers are a few pure functions to manipulate date and time in your JavaScript projects. Think of it as a lightweight alternative to the date manipulation methods of Moment.js.
Usage (node)
Install through npm
npm install --save functional-date-time-helpers
Require the library and use the provided functions
var fdth = var threeMinutesInMilliseconds = fdthvar now = ;var treeMinutesAgo = fdth;
Usage (browser)
Install using bower
bower install --save functional-date-time-helpers
Include it to your html page
<script src="/path/to/dist/functional-date-time-helpers.browser.js" type="text/javascript"></script>
Use the provided functions
var fdth = windowfunctionalDateTimeHelpers;var now = ;var inThreeDays = fdth;
Performance
One of the goals of this library is to provide fast functions for date and time manipulation.
While the popular Moment.js is a great library with lots of functionality it has also some performance problems when manipulating date and time.
That is why I created functional-date-time-helpers with optimized functions that can give you a significant performance boost compared to the equivalent methods of Moment.js.
I also included a benchmark suite that you can run to check the performance of each function.
To run the benchmark simply call this command:
npm run perf