Add to Calendar links
Save the date, anywhere
Let users add your events to their calendar of choice in one click.
composer require symfony/ux-calendar-link
A simple event
Create a CalendarEvent with a title, a start and end date, and optionally a location and description.
Then call ux_calendar_links(event) in your Twig template to get a link for each registered calendar provider.
$timezone = new \DateTimeZone('Europe/Warsaw');
$event = new CalendarEvent(
title: 'SymfonyCon Warsaw 2026',
start: new \DateTimeImmutable('2026-11-26 09:00', $timezone),
end: new \DateTimeImmutable('2026-11-27 18:00', $timezone),
description: 'Share your best practices, experience and knowledge with Symfony.',
location: 'Hilton Warsaw Hotel and Convention Centre, Grzybowska 63, 00-844, Warszawa, Poland',
);
A recurring, all-day event
For events that repeat on a fixed schedule, birthdays, public holidays, weekly team meetings, you don't want users to add them manually every time.
Set allDay: true if the event spans the whole day, and pass a CalendarRecurrence to let the user's calendar handle the repetition automatically.
Recurrence is honored by Google Calendar and the .ics file only.
$timezone = new \DateTimeZone('Europe/Paris');
$event = new CalendarEvent(
title: 'Victory in Europe Day',
start: new \DateTimeImmutable('2025-05-08', $timezone),
end: new \DateTimeImmutable('2025-05-09', $timezone),
description: 'Public holiday in France marking the end of World War II in Europe (1945).',
allDay: true,
recurrence: CalendarRecurrence::yearly(),
);
An event with a reminder
Having the event in the calendar is a good start, but some appointments really need a heads-up.
Pass one or more CalendarReminder instances to remind users ahead of time, a day before, an hour before, whatever makes sense for the event.
Reminders are honored by the .ics file only.
$timezone = new \DateTimeZone('Europe/Paris');
$event = new CalendarEvent(
title: 'Blood donation',
start: new \DateTimeImmutable('2025-06-12 14:00', $timezone),
end: new \DateTimeImmutable('2025-06-12 15:00', $timezone),
location: 'EFS Lyon Part-Dieu, 74 rue de la Villette, 69003 Lyon',
reminders: [
CalendarReminder::before(days: 1, description: 'Eat and drink well.'),
CalendarReminder::before(hours: 2, description: 'Time to go!'),
],
);
Install It
$ composer require symfony/ux-calendar-link