Skip to content

sean1093/timeSolver

Repository files navigation

timeSolver

npm tests license

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

Contents

Installation

Install from npm:

npm install timesolver

Or include the UMD bundle in the browser (dist/timeSolver.umd.min.js).

Usage

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');

Development

Install dependencies and run tests:

npm install
npm test

Build the distribution bundles (requires rollup):

npm run build

Contributing

See 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 test and ensure green
  • Open a PR describing your changes

Changelog

See CHANGELOG.md for the release history.

License

MIT — see LICENSE

About

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.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors