jintervals
jintervals copied to clipboard
JavaScript library for time intervals formatting
When you calculate the difference of two dates in JavaScript you will get the result in milliseconds. But jintervals expects its input in seconds, so you will have to do...
Using `{Greatest}` often results in the loss of too much precision. 1.5 days will be reported by `{Greatest}` as 2 days. That's pretty far from exact. It might be good...
Currently it's like that: ``` jintervals(seconds, format); ``` I would like to make the seconds argument optional, so that calling jintervals with just a format string would give me a...
I have found it error-prone, that I have to use uppercase for first code and lowercase for all others. For example, when I have code like that: ``` jintervals(x, "{MM}:{ss}");...
Years are really hard. As a scientific unit: ``` 1 year == 365.25 days ``` It's hard to deal with fractions. Weeks are seemingly simple. ``` 1 week == 7...
Currently we only allow optional suffix text: ``` jintervals(x, "{Hours? and }{minutes}"); ``` This is usually enough, but it might not always be. For example: ``` jintervals(x, "Hours: {H}, minutes:...