-
How to set the calendar name? There is no setName function in Calendar or CalendarFactory. I have try to override CalendarFactory::getProperties and set my own properties but it is private. What I want to do is adding NAME (or X-WR-CALNAME) property at the header of an output file. So how can I achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So, this is probably not the cleanest way to do it, but I managed to add a calendar display name this way: After I created a calendar component, I used the function $calendarComponent = $calendarFactory->createCalendar(
new Calendar($events)
);
$calendarComponent = $calendarComponent->withProperty(
new Property('X-WR-CALNAME', new TextValue($ical->getTitle()))
); if anyone else knows a better way to add the property to the component, please do @ me. |
Beta Was this translation helpful? Give feedback.
So, this is probably not the cleanest way to do it, but I managed to add a calendar display name this way:
After I created a calendar component, I used the function
withProperty
to "add" the calendar display name property. This will return a clone of your component with the extra property you need.if anyone else knows a better way to add the property to the component, please do @ me.