2024-09-24 17:39:16 +00:00
|
|
|
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(
|
2024-10-30 18:27:42 +00:00
|
|
|
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"),
|
|
|
|
|
),
|
2024-09-24 17:39:16 +00:00
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
}
|