Skip Navigation

[Resolved] generate an ical feed

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 3 voices.

Last updated by Waqar 9 months, 2 weeks ago.

Assisted by: Waqar.

Author
Posts
#2689373

Tell us what you are trying to do?

Hello, I want to add an ical feed to my little toolset-calendar on notenschluessel-lev.de, so that a user can add an event to his/her calendar.

Is there any documentation that you are following?

Is there a similar example that we can see?
I tried this plugin, but it does not work, because the timestamps seems to be not readable or wrong: https://wordpress.org/plugins/ical-feeds/#description / hidden link Another solution is this, but I don't know how to get it running: hidden link

What is the link to your site?
hidden link

Thanks for your help.

#2689438

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Creating an iCal feed from your data is a custom project that's outside the scope of the support we can provide.

The link you shared (hidden link) looks like a promising solution, but we can't adapt it for you to work with your site. If you are not familiar with PHP you may need to recruit a developer to for that for you.

If you are trying to adapt it yourself and have run into some specific problem related to the data you created with Toolset we can try to help with that.

Please give more details of how far you got and what are the relevant details of the specific problem you encountered.

#2690007
nD1RuppWA0.png

Hi Nigel,

I'm going on holiday now for some days.

I have to add my own meta key in the script. If I use ns-termine the result is empty. If I use wpcf-ns-termine I have a date, but it is wrong. Is there a difference between the wp-timestamp and the one toolset uses?

Best, Daniel

#2690038

Hi Daniel,

Thank you for sharing this update.

Toolset's date/time type custom field stores the value in a UNIX timestamp format.
( ref: hidden link )

But in iCal, a different format is required:
"The iCal spec requires that datetimes be formatted either as floating times (no time zone), UTC (with a 'Z' suffix) or with a time zone id at the beginning ('TZID=America/Chicago;...')."

( source: hidden link::Format::ICal#:~:text=The%20iCal%20spec%20requires%20that%20datetimes%20be%20formatted%20either%20as,%3B...'). )

In your code, where you're getting the Toolset date/time custom field value, you can convert it to this format like this:


date_i18n("Ymd\THis\Z", get_post_meta( get_the_ID(), 'wpcf-ns-termine', true ));

Here are some useful resources for a better understanding of this iCal time formatting:

hidden link
https://stackoverflow.com/questions/10518804/formatting-time-for-ical-export

regards,
Waqar