* 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
20 lines
352 B
Go
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"),
|
|
),
|
|
),
|
|
)
|
|
}
|