Skip to content
Star

Calendar and scheduling

Show events on a calendar, handle edits, or calculate dates in a timezone.

Choose calendar calculations or a React view

Use Calendar core for date calculations and event layout. Render Calendar when people need to browse or edit events. For a form field, use Date input, Date picker, Time input, or Time picker.

Try calendar calculations

Install the npm package and import from @collectivecreation/ghost-ui/calendar-core. The core works without React or CSS.

calendar-core.ts

This example prints the parsed date and 1440, the number of minutes in that local day. A day that crosses a daylight-saving change can have 1,380 or 1,500 minutes.

Render an editable calendar

Load the shared component styles, then render TeamCalendar. You can navigate to another date or edit an event. The example keeps changes in React state.

team-calendar.tsx

Use renderEvent to customize what appears inside an event. See the Calendar component API for rendering options.

Supply events and a timezone

Pass events, resources, the visible date, and an IANA timezone such as Asia/Jakarta. Timed events need a timestamp with Z or a numeric offset. For all-day events, end is the first date outside the event. See Calendar data for examples and validation rules.

Save event changes

Apply accepted edits to events from onEventChange. Your app saves the change and handles conflicts or failures. If you expand a recurrence rule or check appointment availability, do that in your app before passing events to Calendar. See Calendar state for edit rules and timezone changes.

API reference

See the Calendar core API for date calculations and event changes. See the Calendar component for view props and examples.

Troubleshooting

  • The date or view stays the same. Update the controlled date or view in its change callback.
  • An event appears on the wrong day. Check the timestamp and the view’s timezone.
  • An edit has no effect. Check editable, onEventChange, and the event’s own edit permission. Point events cannot be resized.