]> git.proxmox.com Git - proxmox-widget-toolkit.git/commit
utils: format_duration_human: calculate years too
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Nov 2021 08:34:41 +0000 (09:34 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Nov 2021 08:39:50 +0000 (09:39 +0100)
commit3ccdce40553d28eddd8cbb1a60534f7e77478f90
tree742eaff607eb8bba327e4f678ea93cba3d023a22
parent6c8df606b1eb9fd5720c1c34ea53c52a2a8fe08d
utils: format_duration_human: calculate years too

Add years and skip showing minute scale once we got over a year,
that's just not relevant anymore at that scale..

Months are just not an ideal thing to show, as they have different
lengths too (leap years have similar issue, but they differ 0.27%
from a normal year, while shortest to longest month is 10.7%
difference!)

Weeks could be done though, they're fixed at 7 days, but for now I
want to avoid unwieldy day numbers like 2634 d as that's just hard to
frame correctly. Also adding years now does not makes adding weeks in
the future impossible anyway..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/Utils.js