diff options
Diffstat (limited to 'crtsh-pem2html.go')
-rw-r--r-- | crtsh-pem2html.go | 7 |
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 { |