all repos — gomponents @ d9708f9290f723dd4424f86d300b18974e2c169b

HTML components in pure Go

Add datetime attribute (#177) `<time>`, `<del>` and `<ins>` can receive a [`datetime`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTimeElement/dateTime) attribute

Julien Tant
commit

d9708f9290f723dd4424f86d300b18974e2c169b

parent

dafb3daa12160c85639fedd3eacf5aaf51127c53

2 files changed, 5 insertions(+), 0 deletions(-)

changed files
M html/attributes.gohtml/attributes.go
@@ -28,6 +28,10 @@ func CrossOrigin(v string) g.Node {
return g.Attr("crossorigin", v) } +func DateTime(v string) g.Node { + return g.Attr("datetime", v) +} + func Defer() g.Node { return g.Attr("defer") }
M html/attributes_test.gohtml/attributes_test.go
@@ -54,6 +54,7 @@ {Name: "cols", Func: Cols},
{Name: "colspan", Func: ColSpan}, {Name: "content", Func: Content}, {Name: "crossorigin", Func: CrossOrigin}, + {Name: "datetime", Func: DateTime}, {Name: "enctype", Func: EncType}, {Name: "dir", Func: Dir}, {Name: "for", Func: For},