Skip to content
forked from nene/jintervals

JavaScript library for time intervals formatting

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

egenial/jintervals

 
 

Repository files navigation

jintervals - formatting time intervals

jintervals is inspired by well-known date and time formatting functions, but is specific to intervals. It takes interval in seconds and produces string according to specified format.

jintervals is a stand-alone library, not dependant of any JavaScript library. Only the development testsuite uses jQuery and QUnit.

jintervals is localized. It currently supports English, Russian, Lithuanian, Finnish and Estonian, plus you can easily add your own.

Examples

Specifying number of decimal places:

jintervals(65, "{MM}:{ss}"); --> 01:05

Hiding of zero values:

jintervals(88, "{M?:}{s}"); --> 1:28
jintervals(28, "{M?:}{s}"); --> 28

Full and abbreviated unit names:

jintervals(75, "{Minutes} and {s.}"); --> 1 minute and 15s

About

JavaScript library for time intervals formatting

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published