GoBrand Calendar

Calendar Core

Framework-agnostic Temporal controller and pure calendar projections.

import { Temporal } from '@js-temporal/polyfill'
import { createCalendar, buildMonthView } from '@gobrand/calendar-core'

type Event = {
  id: string
  title: string
  date: Temporal.PlainDate
}

const events: Event[] = [
  { id: 'launch', title: 'Launch', date: Temporal.Now.plainDateISO() },
]

const calendar = createCalendar({
  views: { month: true },
})

const month = buildMonthView({
  calendar,
  items: events,
  getDate: event => event.date,
})

The calendar starts on today in the device timezone. Pass date or timeZone only when your app needs to control them.