Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-date based time expressions lib #36

Open
rodrigogs opened this issue Sep 18, 2018 · 4 comments
Open

Non-date based time expressions lib #36

rodrigogs opened this issue Sep 18, 2018 · 4 comments

Comments

@rodrigogs
Copy link

rodrigogs commented Sep 18, 2018

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

@stevemao
Copy link
Member

@rodrigogs PR welcome

@rodrigogs
Copy link
Author

@muhdmazran what?

@you-dont-need you-dont-need deleted a comment Oct 5, 2018
@you-dont-need you-dont-need deleted a comment Oct 5, 2018
@tracker1
Copy link

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

@rodrigogs
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants