summaryrefslogtreecommitdiff
path: root/crtsh-pem2html.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-02-06 18:02:11 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-02-06 18:02:15 -0500
commite45ff32aca748b05e0f000daa7536b058d2da089 (patch)
treebeb5421233c7800c4104c7fa6843486df6a6621d /crtsh-pem2html.go
parent2660b8c3da781f3f582c4e1bb5cf7513f0072f6b (diff)
Colorize the last-updated timestamps with JS.
Diffstat (limited to 'crtsh-pem2html.go')
-rw-r--r--crtsh-pem2html.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/crtsh-pem2html.go b/crtsh-pem2html.go
index 0a64848..66961b1 100644
--- a/crtsh-pem2html.go
+++ b/crtsh-pem2html.go
@@ -32,9 +32,10 @@ var tmpl = template.Must(template.New("pem2html").
"green": green,
"date": fDate,
"datetime": fDateTime,
+ "colorDatetime": cDateTime,
}).Parse(`<table class=sortable>
<caption>
- <p>CT log (Updated {{.now | datetime}})</p>
+ <p>CT log (Updated {{.now | colorDatetime}})</p>
</caption>
<tr>
<th>Logged</th>
@@ -65,6 +66,10 @@ func fDateTime(t time.Time) template.HTML {
return template.HTML(t.Local().Format("<time datetime=\"2006-01-02 15:04:05\">2006-01-02 15:04:05</time>"))
}
+func cDateTime(t time.Time) template.HTML {
+ return template.HTML(t.Local().Format("<time class=colordate datetime=\"2006-01-02 15:04:05\">2006-01-02 15:04:05</time>"))
+}
+
func getNow() time.Time {
stat, err := os.Stdin.Stat()
if err == nil {