You-Dont-Need-Momentjs
You-Dont-Need-Momentjs copied to clipboard
Non-date based time expressions lib
I made this pure vanilla library to work with time expressions some time ago. It's pretty small, well tested, completely documented, easy to use and works on both Node.js(any version) and browser(any browser/version).
Maybe somebody could get interested.
Ex.:
const Kairos = require('kairos');
const time = Kairos.new('10:30', 'hh:mm');
time.divide(2);
time.toString('hh:mm:ss'); // 05:15:00
time.multiply(3);
time.toString('hh:mm:ss'); // 15:45:00
time.getMinutes(); // 45
time.toMinutes(); // 945
time.addHours(100);
// Without overflow
time.toString('hh:mm:ss'); // 15:45:00
// With overflow
time.toString('hh:mm:ss', true); // 115:45:00
https://github.com/rodrigogs/kairos
@rodrigogs PR welcome
@muhdmazran what?
@rodrigogs the suggestion is that you create a fork of this project, and add in appropriate edits to use the library in question with a pull request to include it into this repository.
I know @tracker1 . The "what" statement was to another non-sense message that was already deleted.
I'm trying to find time to open a PR hahaha