Skip to content

Non-date based time expressions lib #36

Open
@rodrigogs

Description

@rodrigogs

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions