Calendar Date Format (it differs to the News Module...)
Posted: Thu Nov 16, 2006 5:58 am
Hi there,
I'm sorry to harp of this date format thing but I've done some research and it seems the calendar and news modules handle date formatting differently. The news module was easy enough to modify but I am having a huge headache with the Calendar module - summary template. I've searched the forum to no avail.
I have worked out that I would like my date to appear on the UPCOMING TEMPLATE as: Mon 15 November 06 and have worked out the code needed for this combination would be "%a %d %b %y". The only problem is that the template code has 13 mentions of all sorts of different date formatting and I don't know which one to replace my preferred date ...
I've tried various combinations but nothing is working... Any clues would be highly appreciated. My code is below:
Thanks 
I'm sorry to harp of this date format thing but I've done some research and it seems the calendar and news modules handle date formatting differently. The news module was easy enough to modify but I am having a huge headache with the Calendar module - summary template. I've searched the forum to no avail.
I have worked out that I would like my date to appear on the UPCOMING TEMPLATE as: Mon 15 November 06 and have worked out the code needed for this combination would be "%a %d %b %y". The only problem is that the template code has 13 mentions of all sorts of different date formatting and I don't know which one to replace my preferred date ...
I've tried various combinations but nothing is working... Any clues would be highly appreciated. My code is below:
Code: Select all
{foreach from=$events key=key item=event}
<div class="calendar-event">
{assign var=month_number value=$event.event_date_start|date_format:"%m"}
{assign var=end_month_number value=$event.event_date_end|date_format:"%m"}
{if $event.event_date_start == $event.event_date_end || $event.event_date_end == ""}
<h2>{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]}
{$event.event_date_start|date_format:"%Y"}</h2>
{else}
{if $event.event_date_start|date_format:"%d%m%Y" ==
$event.event_date_end|date_format:"%d%m%Y"}
<h2>{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]}
{$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to}
{$event.event_date_end|date_format:"%H:%M"}</h2>
{else}
<h2>{$event.event_date_start|date_format:"%e"} {$month_names[$month_number]}
{$event.event_date_start|date_format:"%Y %H:%M"} {$lang.to}
{$event.event_date_end|date_format:"%d"} {$month_names[$end_month_number]}
{$event.event_date_end|date_format:"%Y %H:%M"}</h2>
{/if}
{/if}
{if $event.event_summary !="" && ($detail != 1 || ($event.event_details =="" ||
$event.event_details == "<br />"))}
<div class="event-title">{$event.event_title}</div>
<div class="calendar-summary">{$event.event_summary}</div>
{/if}
{if $detail == 1}
{if $event.event_details !="" && $event.event_details != "<br />"}
<div class="calendar-details"><span
class="calendar-details-title">{$lang.details}: </span>{$event.event_details}</div>
{/if}
{else}
{if $event.event_details !="" && $event.event_details != "<br />"}
<a href="{$event.url}">{$moretext}</a>
{/if}
{/if}
</div>
{/foreach}
{if $return_url != ""}
<div class="calendar-returnlink">{$return_url}</div>
{/if}
