[Fencommits] fenserve: render timestamps as links and include date
Tuukka Hastrup
Tuukka.Hastrup at iki.fi
Sat Aug 11 15:33:47 EEST 2007
Sat Aug 11 15:29:47 EEST 2007 Tuukka Hastrup <Tuukka.Hastrup at iki.fi>
* render timestamps as links and include date
diff -rN -u old-fenserve/notetaker/Main.hs new-fenserve/notetaker/Main.hs
--- old-fenserve/notetaker/Main.hs 2007-08-11 15:33:47.000000000 +0300
+++ new-fenserve/notetaker/Main.hs 2007-08-11 15:33:47.000000000 +0300
@@ -167,8 +167,8 @@
renderLine l ++ " (<a href='"++ ?root++"log#"++show t++"'>context</a>)"
renderLine (Line time nick body) =
- "\n<p class='logline' id='"++show time++"'>"
- ++ renderTime time ++ " " ++ renderBody nick body
+ "\n<p class='logline' id='"++show time++"'><a href='#"++show time++"'>"
+ ++ renderTime time ++ "</a> " ++ renderBody nick body
renderBody :: String -> Body -> String
renderBody nick (Body s) = printf "<<b>%s</b>> %s" nick (unformat s)
@@ -187,7 +187,7 @@
renderPath = concat . intersperse "." . map (show . (+1))
renderTime :: EpochTime -> String
-renderTime t0 = printf "%02u:%02u" (ctHour t) (ctMin t)
+renderTime t0 = printf "%04u-%02u-%02u %02u:%02u" (ctYear t) (fromEnum (ctMonth t) + 1) (ctDay t) (ctHour t) (ctMin t)
where t = toUTCTime (TOD (fromIntegral t0) 0)
viewURI (Body _) nick = ("lastlog?nick=" ++ nick, "lastlog" )
More information about the Fencommits
mailing list