about summary refs log tree commit diff stats
path: root/html/attributes.go
diff options
context:
space:
mode:
authorJulien Tant2024-06-21 00:24:11 -0700
committerGitHub2024-06-21 09:24:11 +0200
commitd9708f9290f723dd4424f86d300b18974e2c169b (patch)
treef4a52297acaf49921ef4f795f48f88bb002d8a12 /html/attributes.go
parentdafb3daa12160c85639fedd3eacf5aaf51127c53 (diff)
downloadgomponents-d9708f9290f723dd4424f86d300b18974e2c169b.tar.lz
gomponents-d9708f9290f723dd4424f86d300b18974e2c169b.tar.zst
gomponents-d9708f9290f723dd4424f86d300b18974e2c169b.zip
Add datetime attribute (#177)
`<time>`, `<del>` and `<ins>` can receive a
[`datetime`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTimeElement/dateTime)
attribute
Diffstat (limited to 'html/attributes.go')
-rw-r--r--html/attributes.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/html/attributes.go b/html/attributes.go
index 98d70ff..8a1d11e 100644
--- a/html/attributes.go
+++ b/html/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")
 }