lunaDOM Docs
lunaDOM Docs

lunaDOM is a collection of lightweight, accessible shadowdom based web components built with JavaScript.

v0.0.25

The <luna-relative-time> component displays timestamps as relative time with optional auto-syncing.

Paths

/lunadom/components/relative-time/relative-time.js REQUIRED

Basic Relative Time

Shows time relative to now (e.g., "2 hours ago").

Auto-syncing

Updates automatically as time passes.

Absolute Format

Shows full date and time.

Customization

Attributes
datetime - ISO 8601 datetime string
sync - Auto-update as time passes
format - Display format (relative, absolute)

Example Code

<!-- Basic Relative Time --> <luna-relative-time datetime="2026-02-19T15:00:00Z" > </luna-relative-time> <!-- Auto-syncing Time --> <luna-relative-time datetime="2026-02-19T15:00:00Z" sync > </luna-relative-time> <!-- Absolute Format --> <luna-relative-time datetime="2026-02-19T15:00:00Z" format="absolute" > </luna-relative-time>