htmgo/htmgo-site/partials/time.go
maddalax 35877a1b2e
New Docs (#63)
* scripting enhancements

* tests

* cleanup / tests

* new docs wip

* add more docs

* more updates

* add caching docs

* add sse docs

* more docs

* sidebar, and fix navigation blocks

* remove old docs

* set proper meta

* fixes
2024-10-30 13:27:42 -05:00

20 lines
352 B
Go

package partials
import (
"github.com/maddalax/htmgo/framework/h"
"time"
)
func CurrentTimePartial(ctx *h.RequestContext) *h.Partial {
now := time.Now()
return h.NewPartial(
h.Div(
h.Class("flex gap-1 items-center"),
h.Pf("The current time is "),
h.Span(
h.Text(now.Format(time.RFC3339)),
h.Class("font-bold"),
),
),
)
}