Conversation
supportThanks so much for this awesome plugin! I’ve got everything working and I’m outputting the event dates in MailChimp as *|RSSITEM:DATE:F j – g:i a|*. However, my client has several events that are “All Day” events, and these output with a start time of 12:00 am. The client doesn’t like this and would prefer those events to show as “All Day”. Is there any possible way to accomplish this?
That’s not part of what this plugin alters in The Events Calendar’s RSS feed, so it must be outputting the event data this way. Are you sure the client has the “All Day” checkbox checked on these events, and didn’t enter 12:00 AM – 11:59 PM as the times? If TEC is really outputting all-day events with a 12:00 AM start time instead of omitting the time altogether, that seems like a bug they may need to fix, but I could investigate adding an option to my plugin to workaround it in the meantime.
I’ve confirmed that they have selected “All day” on those events. Below is an example from the RSS feed of one of the all day events. It does say “All day” within the <content:encoded> tags, but I assume the date/time is being pulled in from the <pubDate> tag? <item> <title>Sunflower Winter Invitational</title> <link>https://visitemporia.com/event/sunflower-winter-invitational/</link> <dc:creator><![CDATA[Kelly]]></dc:creator> <pubDate>Sat, 04 Feb 2023 06:00:00 +0000</pubDate> <guid isPermaLink="false">https://visitemporia.com/?post_type=tribe_events&p=36626</guid> <description><![CDATA[<p>USA Gymnastics Sanctioned Trampoline and Tumbling Competition hosted by Sunflower Gymnastics.</p> <p>The post <a rel="nofollow" href="https://visitemporia.com/event/sunflower-winter-invitational/">Sunflower Winter Invitational</a> appeared first on <a rel="nofollow" href="https://visitemporia.com">Visit Emporia, Kansas</a>.</p> ]]></description> <content:encoded><![CDATA[<div class="tribe-events-schedule tribe-clearfix"> <h2 class="tribe-events-schedule__datetime"> <span class="tribe-events-schedule__date tribe-events-schedule__date--start"> February 4, 2023 </span> <span class="tribe-events-schedule__all-day">All day</span> </h2> </div>
Thanks… I think the issue is because of the way you’re formatting the date/time with the MailChimp template tags, which includes the time format. It looks like TEC does use the RSS <pubDate> tag to put the event’s date into the feed. I’m not sure if there’s a way to get that format to be different, or if it’s possible to use conditional logic with MailChimp’s template tags. Unfortunately none of this has to do with what my RSS Enhancements plugin actually changes about the TEC feed output, so it’s outside the scope of the support I can provide here. You may need to open a support ticket with the TEC team since it’s their direct RSS output that is generating the <pubDate> tag, not my plugin. This reply was modified 3 years, 6 months ago by Room 34 Creative Services, LLC .
It’s not possible with conditional Mailchimp tags unfortunately, but I did come up with a solution after scouring TEC’s documentation. Posted below if anyone else wants to try this. Basically, I fudged a formatted date into the <category> tag. A little hacky, but I don’t use categories with TEC and categories do not show in TEC’s RSS feed by default anyway. The code outputs both All Day and Multi-day events in the format I’m looking for within the ‘<category>’ tag. Then I was able to pull that into Mailchimp using *|RSSITEM:CATEGORIES|* . My PHP is beginner level, but I was able to follow what you did. Thanks again for the plugin! function my_enhanced_date_format () { // Add a formatted date that properly displays All Day events and multi-day events (fudged into the <category> tag) $my_start_date = tribe_get_start_date(); // get formatted tribe start date and time $my_end_date = tribe_get_end_date(); // get formatted tribe end date and time if ( tribe_event_is_multiday( $event ) ) { // check if tribe event is multi-day echo "<category>$my_start_date to $my_end_date</category>"; } elseif ( tribe_event_is_all_day( $event ) ) { // check if tribe event is all day echo '<category>All Day</category>'; } else { echo "<category>$my_start_date</category>"; } } add_action( 'r34ecre_rss_modify_item_after', 'my_enhanced_date_format', 1 );
Thanks for sharing this code you worked out… I’m glad the custom hooks in my plugin were able to help here. 😀
That’s not part of what this plugin alters in The Events Calendar’s RSS feed, so it must be outputting the event data this way. Are you sure the client has the “All Day” checkbox checked on these events, and didn’t enter 12:00 AM – 11:59 PM as the times? If TEC is really outputting all-day events with a 12:00 AM start time instead of omitting the time altogether, that seems like a bug they may need to fix, but I could investigate adding an option to my plugin to workaround it in the meantime.
I’ve confirmed that they have selected “All day” on those events. Below is an example from the RSS feed of one of the all day events. It does say “All day” within the <content:encoded> tags, but I assume the date/time is being pulled in from the <pubDate> tag? <item> <title>Sunflower Winter Invitational</title> <link>https://visitemporia.com/event/sunflower-winter-invitational/</link> <dc:creator><![CDATA[Kelly]]></dc:creator> <pubDate>Sat, 04 Feb 2023 06:00:00 +0000</pubDate> <guid isPermaLink="false">https://visitemporia.com/?post_type=tribe_events&p=36626</guid> <description><![CDATA[<p>USA Gymnastics Sanctioned Trampoline and Tumbling Competition hosted by Sunflower Gymnastics.</p> <p>The post <a rel="nofollow" href="https://visitemporia.com/event/sunflower-winter-invitational/">Sunflower Winter Invitational</a> appeared first on <a rel="nofollow" href="https://visitemporia.com">Visit Emporia, Kansas</a>.</p> ]]></description> <content:encoded><![CDATA[<div class="tribe-events-schedule tribe-clearfix"> <h2 class="tribe-events-schedule__datetime"> <span class="tribe-events-schedule__date tribe-events-schedule__date--start"> February 4, 2023 </span> <span class="tribe-events-schedule__all-day">All day</span> </h2> </div>
Thanks… I think the issue is because of the way you’re formatting the date/time with the MailChimp template tags, which includes the time format. It looks like TEC does use the RSS <pubDate> tag to put the event’s date into the feed. I’m not sure if there’s a way to get that format to be different, or if it’s possible to use conditional logic with MailChimp’s template tags. Unfortunately none of this has to do with what my RSS Enhancements plugin actually changes about the TEC feed output, so it’s outside the scope of the support I can provide here. You may need to open a support ticket with the TEC team since it’s their direct RSS output that is generating the <pubDate> tag, not my plugin. This reply was modified 3 years, 6 months ago by Room 34 Creative Services, LLC .
It’s not possible with conditional Mailchimp tags unfortunately, but I did come up with a solution after scouring TEC’s documentation. Posted below if anyone else wants to try this. Basically, I fudged a formatted date into the <category> tag. A little hacky, but I don’t use categories with TEC and categories do not show in TEC’s RSS feed by default anyway. The code outputs both All Day and Multi-day events in the format I’m looking for within the ‘<category>’ tag. Then I was able to pull that into Mailchimp using *|RSSITEM:CATEGORIES|* . My PHP is beginner level, but I was able to follow what you did. Thanks again for the plugin! function my_enhanced_date_format () { // Add a formatted date that properly displays All Day events and multi-day events (fudged into the <category> tag) $my_start_date = tribe_get_start_date(); // get formatted tribe start date and time $my_end_date = tribe_get_end_date(); // get formatted tribe end date and time if ( tribe_event_is_multiday( $event ) ) { // check if tribe event is multi-day echo "<category>$my_start_date to $my_end_date</category>"; } elseif ( tribe_event_is_all_day( $event ) ) { // check if tribe event is all day echo '<category>All Day</category>'; } else { echo "<category>$my_start_date</category>"; } } add_action( 'r34ecre_rss_modify_item_after', 'my_enhanced_date_format', 1 );
Thanks for sharing this code you worked out… I’m glad the custom hooks in my plugin were able to help here. 😀