On our website we are listing a number of events that are formatted as follows:
In-depth Tax Course Part 1 & 2
May 27 - June 1, 2012
Toronto, ON
Since we use this info in multiple locations throughout the site, we’re using the event content type and templating this format.
The issue I"ve run into is where the start and end dates go through multiple dates. What my template is currently doing is the following
In-depth Tax Course Part 1 & 2
May 27 - 01, 2012
Toronto, ON
How can I get it to display the month?
Here’s my code:
#set($retrieve_event_start_date = $sys.item.getProperty("event_start").Date)
#set($retrieve_event_end_date = $sys.item.getProperty("event_end").Date)
#if($retrieve_event_start_date)
#if($retrieve_event_end_date)
#if ($lang == 'fr-ca')
#set($displayEventStartDate = $tools.date.format("d-", $retrieve_event_start_date, $user.psoStringTools.getLocale("fr-ca")))
#else
#set($displayEventStartDate = $tools.date.format("MMMM dd - ",$sys.item.getProperty("event_start").Date))
#end
#else
#if ($lang == 'fr-ca')
#set($displayEventStartDate = $tools.date.format("d MMMM yyyy", $retrieve_event_start_date, $user.psoStringTools.getLocale("fr-ca")))
#else
#set($displayEventStartDate = $tools.date.format("MMMM dd, yyyy ",$sys.item.getProperty("event_start").Date))
#end
#end
#end
#if($retrieve_event_end_date)
#if ($lang == 'fr-ca')
#set($displayEventEndDate = $tools.date.format("d MMMM yyyy", $retrieve_event_end_date, $user.psoStringTools.getLocale("fr-ca")))
#else
#set($displayEventEndDate = $tools.date.format("dd, yyyy",$sys.item.getProperty("event_end").Date))
#end
#end
#if($eventLink)
<a target="_blank" href="${eventLink}">#displayfield("displaytitle")</a><br />
#else
#field("displaytitle")<br />
#end
#if($retrieve_event_end_date)
<strong>${displayEventStartDate}${displayEventEndDate}</strong><br />
#elseif ($retrieve_event_start_date)
<strong>${displayEventStartDate}</strong><br />
#end
#field_if_set("" "description" "<br />")
#field_if_set("" "event_location" "")