Pure Hiccup UI components for calendar views.
All functions are pure — they receive data and return Hiccup structures. No side effects, no I/O, no HTMX-specific markup. Composable into any Ring handler or Hiccup template.
Components: event-badge — colored pill with title and time day-cell — single day grid cell with event badges month-view — full month calendar grid week-view — 7-column week grid with hourly rows mini-calendar — compact month navigator for sidebars
Labels are [:t key] markers, resolved by wagoe.i18n.shell.render. A page rendered with plain hiccup2 shows them as <t> tags, so either render through i18n or pass a :t fn (key -> string) in opts to resolve them here.
Pure Hiccup UI components for calendar views. All functions are pure — they receive data and return Hiccup structures. No side effects, no I/O, no HTMX-specific markup. Composable into any Ring handler or Hiccup template. Components: event-badge — colored pill with title and time day-cell — single day grid cell with event badges month-view — full month calendar grid week-view — 7-column week grid with hourly rows mini-calendar — compact month navigator for sidebars Labels are [:t key] markers, resolved by wagoe.i18n.shell.render. A page rendered with plain hiccup2 shows them as <t> tags, so either render through i18n or pass a :t fn (key -> string) in opts to resolve them here.
(day-cell date events)(day-cell date events opts)Render a single day cell in a calendar grid.
Args: date - java.time.LocalDate events - seq of EventData maps (already filtered to this day) opts - map with optional keys: :today LocalDate — if date equals today, adds .today CSS class :selected-date LocalDate — if date equals selected, adds .selected CSS class :timezone string — for event time display (default UTC) :event-href fn event -> url, see event-badge
Returns: Hiccup [:div.day-cell ...] element
Render a single day cell in a calendar grid.
Args:
date - java.time.LocalDate
events - seq of EventData maps (already filtered to this day)
opts - map with optional keys:
:today LocalDate — if date equals today, adds .today CSS class
:selected-date LocalDate — if date equals selected, adds .selected CSS class
:timezone string — for event time display (default UTC)
:event-href fn event -> url, see event-badge
Returns:
Hiccup [:div.day-cell ...] element(event-badge event)(event-badge event timezone)(event-badge event
timezone
{:keys [event-href show-time?]
:or {show-time? (not (event/all-day? event))}})Render a single event as a colored pill showing title and start time.
Args: event - EventData map; an :href key links the badge (a scheme other than http(s)/mailto is dropped), :all-day? true hides the time timezone - string timezone for local-time display (default UTC) opts - map with optional keys: :event-href fn event -> url, used when the event has no :href :show-time? false to hide the time (default: not all-day)
Returns: Hiccup [:div.event-badge ...], or [:a.event-badge ...] when it links
Render a single event as a colored pill showing title and start time.
Args:
event - EventData map; an :href key links the badge (a scheme other
than http(s)/mailto is dropped), :all-day? true hides the time
timezone - string timezone for local-time display (default UTC)
opts - map with optional keys:
:event-href fn event -> url, used when the event has no :href
:show-time? false to hide the time (default: not all-day)
Returns:
Hiccup [:div.event-badge ...], or [:a.event-badge ...] when it links(mini-calendar year month selected-date)(mini-calendar year month selected-date opts)Render a compact month navigator suitable for sidebars.
Renders day numbers only (no event badges). Highlights today and selected date. Prev/next navigation links use query-param convention: ?year=Y&month=M.
Args: year - integer month - integer 1–12 selected-date - java.time.LocalDate or nil opts - map with optional keys: :today LocalDate — highlight today :t fn key -> string, resolves labels here
Returns: Hiccup [:div.mini-calendar ...] element
Render a compact month navigator suitable for sidebars.
Renders day numbers only (no event badges). Highlights today and selected date.
Prev/next navigation links use query-param convention: ?year=Y&month=M.
Args:
year - integer
month - integer 1–12
selected-date - java.time.LocalDate or nil
opts - map with optional keys:
:today LocalDate — highlight today
:t fn key -> string, resolves labels here
Returns:
Hiccup [:div.mini-calendar ...] element(month-view year month events)(month-view year month events opts)Render a full month calendar grid.
Renders a 7-column grid (Mon–Sun) with rows for each week. Days from the previous and next months are rendered as empty filler cells. An event shows on every day it covers within the month.
Args: year - integer (e.g. 2026) month - integer 1–12 events - seq of EventData maps (filtered to this month by the caller, or pass all) opts - map with optional keys: :today LocalDate — highlight today :selected-date LocalDate — highlight selected date :timezone string — for event time display (default UTC) :event-href fn event -> url, see event-badge :t fn key -> string, resolves labels here
Returns: Hiccup [:div.calendar-month ...] element
Render a full month calendar grid.
Renders a 7-column grid (Mon–Sun) with rows for each week.
Days from the previous and next months are rendered as empty filler cells.
An event shows on every day it covers within the month.
Args:
year - integer (e.g. 2026)
month - integer 1–12
events - seq of EventData maps (filtered to this month by the caller, or pass all)
opts - map with optional keys:
:today LocalDate — highlight today
:selected-date LocalDate — highlight selected date
:timezone string — for event time display (default UTC)
:event-href fn event -> url, see event-badge
:t fn key -> string, resolves labels here
Returns:
Hiccup [:div.calendar-month ...] element(week-view start-date events)(week-view start-date events opts)Render a 7-column week grid with hourly time rows (00:00–23:00).
All-day events and events of 24 hours or more go in an all-day row above the hours, on each day of the week they cover; shorter ones, overnight ones included, sit in the hour they start.
Args: start-date - java.time.LocalDate (Monday of the week to display) events - seq of EventData maps opts - map with optional keys: :today LocalDate — highlight today's column :timezone string — for event time display (default UTC) :event-href fn event -> url, see event-badge :t fn key -> string, resolves labels here
Returns: Hiccup [:div.calendar-week ...] element
Render a 7-column week grid with hourly time rows (00:00–23:00).
All-day events and events of 24 hours or more go in an all-day row above
the hours, on each day of the week they cover; shorter ones, overnight ones
included, sit in the hour they start.
Args:
start-date - java.time.LocalDate (Monday of the week to display)
events - seq of EventData maps
opts - map with optional keys:
:today LocalDate — highlight today's column
:timezone string — for event time display (default UTC)
:event-href fn event -> url, see event-badge
:t fn key -> string, resolves labels here
Returns:
Hiccup [:div.calendar-week ...] elementcljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |