Initial version.

Features:

- Upload PDF files let them analyze

- Manage meta data and items

- See processing in webapp
This commit is contained in:
Eike Kettner
2019-07-23 00:53:30 +02:00
parent 6154e6a387
commit 831cd8b655
341 changed files with 23634 additions and 484 deletions

View File

@ -0,0 +1,47 @@
module Util.Duration exposing (Duration, toHuman)
-- 486ms -> 12s -> 1:05 -> 59:45 -> 1:02:12
type alias Duration = Int
toHuman: Duration -> String
toHuman dur =
fromMillis dur
-- implementation
fromMillis: Int -> String
fromMillis ms =
case ms // 1000 of
0 ->
(String.fromInt ms) ++ "ms"
n ->
fromSeconds n
fromSeconds: Int -> String
fromSeconds sec =
case sec // 60 of
0 ->
(String.fromInt sec) ++ "s"
n ->
let
s = sec - (n * 60)
in
(fromMinutes n) ++ ":" ++ (num s)
fromMinutes: Int -> String
fromMinutes min =
case min // 60 of
0 ->
(num min)
n ->
let
m = min - (n * 60)
in
(num n) ++ ":" ++ (num m)
num: Int -> String
num n =
String.fromInt n
|> (++) (if n < 10 then "0" else "")