Skip to content

Commit 74889b4

Browse files
committed
second round feedbacks
1 parent 8348232 commit 74889b4

2 files changed

Lines changed: 17 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: 16 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,25 @@
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-
1817
$ composer require symfony/ux-calendar-link
1918
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-
3019
Usage
3120
-----
3221

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

3724
// src/Controller/EventController.php
3825
namespace App\Controller;
@@ -52,7 +39,7 @@ Build a ``CalendarEvent`` in your controller and pass it to Twig:
5239
title: 'Symfony Live Paris',
5340
start: new \DateTimeImmutable('2026-05-14 09:00'),
5441
end: new \DateTimeImmutable('2026-05-15 18:00'),
55-
location: 'Disneyland Paris',
42+
location: 'Cité Universitaire Paris',
5643
description: 'Annual Symfony conference',
5744
);
5845

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

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-
11786
Reminders and recurrence
11887
------------------------
11988

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

12291
use Symfony\UX\CalendarLink\CalendarEvent;
12392
use Symfony\UX\CalendarLink\CalendarRecurrence;
@@ -135,16 +104,19 @@ Reminders and recurrence
135104
``minutely()``, ``daily()``, ``weekly()``, ``monthly()``, ``yearly()`` — each
136105
accepting the usual ``interval``, ``count`` and ``until`` named arguments:
137106

138-
::
107+
A few common patterns::
139108

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

144116
All-day events
145117
--------------
146118

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

149121
$holiday = new CalendarEvent(
150122
title: 'Bastille Day',

0 commit comments

Comments
 (0)