diff options
-rw-r--r-- | crtsh-pem2html.go | 8 | ||||
-rw-r--r-- | tls-pem2html.go | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/crtsh-pem2html.go b/crtsh-pem2html.go index f856ffb..612e421 100644 --- a/crtsh-pem2html.go +++ b/crtsh-pem2html.go @@ -30,7 +30,7 @@ var tmpl = template.Must(template.New("pem2html"). Funcs(template.FuncMap{ "red": red, "green": green, - "time": fTime, + "date": fDate, "datetime": fDateTime, }).Parse(`<!DOCTYPE html> <html lang="en"> @@ -98,8 +98,8 @@ var tmpl = template.Must(template.New("pem2html"). {{range $cert := .certs}} <tr> <td style="background-color: {{$cert.Updated | green}}"><a target="_blank" href="{{$cert.Url}}">{{$cert.Updated | datetime}}</a></td> - <td><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.NotBefore | time}}</a></td> - <td style="background-color: {{$cert.X509.NotAfter | red}}"><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.NotAfter | time}}</a></td> + <td><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.NotBefore | date}}</a></td> + <td style="background-color: {{$cert.X509.NotAfter | red}}"><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.NotAfter | date}}</a></td> <td><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.Subject.CommonName}}</a></td> <td><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.Issuer.Organization}}</a></td> </tr> @@ -109,7 +109,7 @@ var tmpl = template.Must(template.New("pem2html"). </html> `)) -func fTime(t time.Time) template.HTML { +func fDate(t time.Time) template.HTML { return template.HTML(t.Local().Format("<time datetime=\"2006-01-02 15:04:05\" title=\"2006-01-02 15:04:05\">2006-01-02 <span class=time>15:04:05</span></time>")) } diff --git a/tls-pem2html.go b/tls-pem2html.go index 6cecbf6..f3581fd 100644 --- a/tls-pem2html.go +++ b/tls-pem2html.go @@ -30,7 +30,7 @@ var tmpl = template.Must(template.New("pem2html"). Funcs(template.FuncMap{ "red": red, "green": green, - "time": fTime, + "date": fDate, "datetime": fDateTime, }).Parse(`<!DOCTYPE html> <html lang="en"> @@ -99,8 +99,8 @@ var tmpl = template.Must(template.New("pem2html"). </tr> {{range $cert := .certs}} <tr class="{{$cert.Class}}"> - <td style="background-color: {{$cert.X509.NotBefore | green}}"><a href="{{$cert.Url}}" title="{{$cert.Error}}">{{$cert.X509.NotBefore | time}}</a></td> - <td style="background-color: {{$cert.X509.NotAfter | red }}"><a href="{{$cert.Url}}" title="{{$cert.Error}}">{{$cert.X509.NotAfter | time}}</a></td> + <td style="background-color: {{$cert.X509.NotBefore | green}}"><a href="{{$cert.Url}}" title="{{$cert.Error}}">{{$cert.X509.NotBefore | date}}</a></td> + <td style="background-color: {{$cert.X509.NotAfter | red }}"><a href="{{$cert.Url}}" title="{{$cert.Error}}">{{$cert.X509.NotAfter | date}}</a></td> <td><a href="{{$cert.Url}}" title="{{$cert.Error}}">{{$cert.X509.Subject.CommonName | html}}</a></td> <td><a href="{{$cert.Url}}" title="{{$cert.Error}}">{{$cert.Socket | html}}</a></td> </tr> @@ -110,7 +110,7 @@ var tmpl = template.Must(template.New("pem2html"). </html> `)) -func fTime(t time.Time) template.HTML { +func fDate(t time.Time) template.HTML { return template.HTML(t.Local().Format("<time datetime=\"2006-01-02 15:04:05\" title=\"2006-01-02 15:04:05\">2006-01-02 <span class=time>15:04:05</span></time>")) } |