You-Dont-Need-Momentjs icon indicating copy to clipboard operation
You-Dont-Need-Momentjs copied to clipboard

Non-date based time expressions lib

Open rodrigogs opened this issue 6 years ago • 4 comments

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 avatar Sep 18 '18 18:09 rodrigogs

@rodrigogs PR welcome

stevemao avatar Sep 18 '18 23:09 stevemao

@muhdmazran what?

rodrigogs avatar Sep 24 '18 15:09 rodrigogs

@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.

tracker1 avatar Oct 15 '18 23:10 tracker1

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

rodrigogs avatar Oct 16 '18 00:10 rodrigogs