time

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DateTime

func DateTime(datetime string, content string) *element

DateTime Creates a new time element with datetime attribute and text content Example: time.DateTime("2023-12-25", "Christmas Day") Renders: <time datetime="2023-12-25">Christmas Day</time>

func New

func New(nodes ...node.Node) *element

New Creates a new time element with optional child nodes Example: time.New() Renders: <time></time>

func RawText

func RawText(content string) *element

RawText Creates a new time element with raw text content Example: time.RawText("December 25, 2023") Renders: <time>December 25, 2023</time>

func RawTextf

func RawTextf(format string, args ...any) *element

RawTextf Creates a new time element with formatted raw text content as unescaped HTML. Example: time.RawTextf("Date: <em>%s</em>", "2023-12-25") Renders: <time>Date: <em>2023-12-25</em></time>

func Static

func Static(content string) *element

Static Creates a new time element with static text content. Example: time.Static("Hello World") Renders: <time>Hello World</time>

func Text

func Text(content string) *element

Text Creates a new time element with text content Example: time.Text("December 25, 2023") Renders: <time>December 25, 2023</time>

func Textf

func Textf(format string, args ...any) *element

Textf Creates a new time element with formatted text content (HTML-encoded). Example: time.Textf("Date: %s", "2023-12-25") Renders: <time>Date: 2023-12-25</time>

Types

type Element

type Element = element

Element is an exported alias for the private element type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL