timeSolver is a small, zero-dependency JavaScript utility for manipulating,
validating and formatting Date objects. It also includes a lightweight
timeLook helper to measure execution intervals during development.
Current version: v1.2.0
Install from npm:
npm install timesolverOr include the UMD bundle in the browser (dist/timeSolver.umd.min.js).
CommonJS:
const timeSolver = require('timesolver');ES Module:
import timeSolver from 'timesolver';Browser global (after including UMD bundle):
timeSolver.getString(new Date(), 'YYYYMMDD');Examples:
timeSolver.add('2020-01-01', 1, 'D'); // add 1 day
timeSolver.between('2020-01-01', '2020-01-02', 'H'); // hours between
timeSolver.getString(new Date(), 'YYYY-MM-DD HH:MM:SS.SSS');Install dependencies and run tests:
npm install
npm testBuild the distribution bundles (requires rollup):
npm run buildSee CONTRIBUTING.md for contribution guidelines, branching model and testing
requirements. In short:
- Fork and create a feature branch
- Add tests for new behavior
- Run
npm testand ensure green - Open a PR describing your changes
See CHANGELOG.md for the release history.
MIT — see LICENSE