@@ -12,9 +12,7 @@ import (
1212)
1313
1414// DateTime renders an absolute time HTML element by datetime.
15- func DateTime (format string , datetime any , extraAttrs ... string ) template.HTML {
16- // TODO: remove the extraAttrs argument, it's not used in any call to DateTime
17-
15+ func DateTime (format string , datetime any ) template.HTML {
1816 if p , ok := datetime .(* time.Time ); ok {
1917 datetime = * p
2018 }
@@ -34,9 +32,6 @@ func DateTime(format string, datetime any, extraAttrs ...string) template.HTML {
3432 switch v := datetime .(type ) {
3533 case nil :
3634 return "-"
37- case string :
38- datetimeEscaped = html .EscapeString (v )
39- textEscaped = datetimeEscaped
4035 case time.Time :
4136 if v .IsZero () || v .Unix () == 0 {
4237 return "-"
@@ -51,10 +46,7 @@ func DateTime(format string, datetime any, extraAttrs ...string) template.HTML {
5146 panic (fmt .Sprintf ("Unsupported time type %T" , datetime ))
5247 }
5348
54- attrs := make ([]string , 0 , 10 + len (extraAttrs ))
55- attrs = append (attrs , extraAttrs ... )
56- attrs = append (attrs , `weekday=""` , `year="numeric"` )
57-
49+ attrs := []string {`weekday=""` , `year="numeric"` }
5850 switch format {
5951 case "short" , "long" : // date only
6052 attrs = append (attrs , `month="` + format + `"` , `day="numeric"` )
0 commit comments