Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
def seconds_to_time_string:
|
||||
def nonzero(text): floor | if . > 0 then "\(.) \(text)" else empty end;
|
||||
if . == 0 then "0 sec"
|
||||
else
|
||||
[(./60/60/24/7 | nonzero("wk")),
|
||||
(./60/60/24 % 7 | nonzero("d")),
|
||||
(./60/60 % 24 | nonzero("hr")),
|
||||
(./60 % 60 | nonzero("min")),
|
||||
(. % 60 | nonzero("sec"))]
|
||||
| join(", ")
|
||||
end;
|
||||
|
|
@ -0,0 +1 @@
|
|||
0, 7259, 86400, 6000000 | "\(.): \(seconds_to_time_string)"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
$ jq -r -n -f Convert_seconds_to_compound_duration.jq
|
||||
0: 0 sec
|
||||
7259: 2 hr, 59 sec
|
||||
86400: 1 d
|
||||
6000000: 9 wk, 6 d, 10 hr, 40 min
|
||||
Loading…
Add table
Add a link
Reference in a new issue