Skip to content

Commit c83ae65

Browse files
committed
second round feedbacks
1 parent 8348232 commit c83ae65

2 files changed

Lines changed: 18 additions & 49 deletions

File tree

src/CalendarLink/config/services.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@
2323
use Symfony\UX\CalendarLink\Twig\UXCalendarLinkRuntime;
2424

2525
return static function (ContainerConfigurator $container): void {
26-
$services = $container->services()
27-
->defaults()
28-
->autowire()
29-
->autoconfigure()
30-
->private();
26+
$services = $container->services();
3127

3228
$services->set('ux_calendar_link.provider.google', GoogleCalendarLinkProvider::class)
3329
->tag('ux_calendar_link.provider');

src/CalendarLink/doc/index.rst

Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,26 @@
11
Symfony UX Calendar Link
22
========================
33

4-
**Symfony UX Calendar Link** generates "Add to calendar" links for Google
5-
Calendar, Outlook.com, Office 365 and iCalendar (``.ics``) — the format
4+
**EXPERIMENTAL** This component is currently experimental and is likely
5+
to change, or even change drastically.
6+
7+
Symfony UX CalendarLink is a Symfony bundle that allows generator of "Add to calendar" links for Google
8+
Calendar, Outlook.com, Office 365 and iCalendar (``.ics``), the format
69
consumed by Apple Calendar, Outlook desktop, Thunderbird and every native
710
calendar client.
811

9-
It addresses the long-standing request in
10-
`symfony/ux#3308 <https://github.com/symfony/ux/issues/3308>`_ for a
11-
first-party "Add to calendar" component in the Symfony UX initiative.
12-
1312
Installation
1413
------------
1514

15+
Install the bundle using Composer and Symfony Flex:
1616
.. code-block:: terminal
17-
17+
1818
$ composer require symfony/ux-calendar-link
1919
20-
If you're not using Symfony Flex, enable the bundle manually:
21-
22-
::
23-
24-
// config/bundles.php
25-
return [
26-
// ...
27-
Symfony\UX\CalendarLink\UXCalendarLinkBundle::class => ['all' => true],
28-
];
29-
3020
Usage
3121
-----
3222

33-
Build a ``CalendarEvent`` in your controller and pass it to Twig:
34-
35-
::
23+
Start by creating a CalendarEvent object in your controller. Once populated with your event details, pass it to Twig to render the calendar links::
3624

3725
// src/Controller/EventController.php
3826
namespace App\Controller;
@@ -52,7 +40,7 @@ Build a ``CalendarEvent`` in your controller and pass it to Twig:
5240
title: 'Symfony Live Paris',
5341
start: new \DateTimeImmutable('2026-05-14 09:00'),
5442
end: new \DateTimeImmutable('2026-05-15 18:00'),
55-
location: 'Disneyland Paris',
43+
location: 'Cité Universitaire Paris',
5644
description: 'Annual Symfony conference',
5745
);
5846

@@ -96,28 +84,10 @@ provider, because the provider's URL scheme does not support them. For example,
9684
reminders are honoured only in the ``.ics`` output since Google and Outlook
9785
deeplink URLs cannot carry VALARM data.
9886

99-
A note on Apple Calendar and EventKit
100-
-------------------------------------
101-
102-
Apple's EventKit (``EKEvent`` / ``EKEventStore``) is a **native iOS/macOS
103-
API**, not a web URL scheme. There is no proprietary "Add to Apple Calendar"
104-
deeplink. The correct way to target Apple Calendar from a web page is to
105-
serve an RFC 5545 ``.ics`` file — Safari on iOS and macOS recognize the
106-
``text/calendar`` MIME type and offers to add the event directly. The ``ics``
107-
provider covers Apple Calendar, Outlook desktop, Thunderbird and every other
108-
native calendar client in a single link.
109-
110-
ICS delivery
111-
------------
112-
113-
The ``ics`` provider always returns a
114-
``data:text/calendar;charset=utf-8;base64,...`` URL containing the full
115-
VCALENDAR payload.
116-
11787
Reminders and recurrence
11888
------------------------
11989

120-
::
90+
Both recurrence rules and reminders can be attached when constructing the event::
12191

12292
use Symfony\UX\CalendarLink\CalendarEvent;
12393
use Symfony\UX\CalendarLink\CalendarRecurrence;
@@ -135,16 +105,19 @@ Reminders and recurrence
135105
``minutely()``, ``daily()``, ``weekly()``, ``monthly()``, ``yearly()`` — each
136106
accepting the usual ``interval``, ``count`` and ``until`` named arguments:
137107

138-
::
108+
A few common patterns::
139109

140-
CalendarRecurrence::daily(interval: 2); // every other day
141-
CalendarRecurrence::monthly(count: 6); // six monthly occurrences
110+
// every other day
111+
CalendarRecurrence::daily(interval: 2);
112+
// six monthly occurrences
113+
CalendarRecurrence::monthly(count: 6);
114+
// yearly until 2030
142115
CalendarRecurrence::yearly(until: new \DateTimeImmutable('2030-01-01'));
143116

144117
All-day events
145118
--------------
146119

147-
::
120+
Pass allDay: true to create an event with no specific start or end time::
148121

149122
$holiday = new CalendarEvent(
150123
title: 'Bastille Day',

0 commit comments

Comments
 (0)