diff options
Diffstat (limited to 'lib/views.ml')
-rw-r--r-- | lib/views.ml | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/views.ml b/lib/views.ml index 576fa14..392075f 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -99,9 +99,15 @@ module Repo = struct HTML.(li [] [ Routes.link_to (Refs repo) (txt "%s" branch.name) ]) let li_of_commit repo (commit : Resolvers.Commit.t) = - let short_hash = Resolvers.short_hash commit.hash in - let hash_span = - HTML.(span [ class_ "commit-hash" ] [ txt "%s" short_hash ]) + let timestamp (date, _) = + let tm = date |> Int64.to_float |> Unix.localtime in + Printf.sprintf "%04d-%02d-%02d %02d:%02d" (tm.tm_year + 1900) + (tm.tm_mon + 1) tm.tm_mday tm.tm_hour tm.tm_min + in + let timestamp_span = + (* HTML.(span [ class_ "commit-hash" ] [ txt "%s" commit.datetime ]) *) + HTML.( + span [ class_ "timestamp" ] [ txt "%s" (timestamp commit.author.date) ]) in let description = match commit.message with @@ -109,7 +115,7 @@ module Repo = struct | Some msg -> txt " %s" msg in let route = Routes.Commit (repo, commit.hash) in - let node = HTML.null [ hash_span; description ] in + let node = HTML.null [ timestamp_span; description ] in HTML.li [] [ Routes.link_to route node ] let li_of_entry repo (entry : Resolvers.Entry.t) = |