I have a calendar page that displays a monthly calendar and a simple listing of events for that month. Both display properly when the URL references the month (i.e. /events/2009/02/) but on the main calendar page (/events/) the event list only displays events for the current day, which is the repeet default since the URL doesn’t include a date structure.
If I add Begin and End tags with specific dates to the exp:repeet:get_ids it works fine:
{exp:repeet:get_ids weblog="events" parse="inward" begin="2009-01-01" end="2009-01-31"}
My problem is that I want the main events page to display events for the current month, so I don’t want to have to hard code the begin and end days for a particular month.
Is there a way to format the begin/end dates relatively? I can seem to figure it out. Here’s the formatting you’re supposed to use: http://www.gnu.org/software/tar/manual/html_section/Date-input-formats.html
Here’s my code for the event list:
{exp:repeet:parse date_header_interval="month"}
{repeet:date_header}<h2>Event Details for %F:</h2>{/repeet:date_header}
{exp:repeet:get_ids weblog="events" parse="inward" begin="2009-01-01" end="2009-01-31"}
{exp:weblog:entries weblog="events" display_by="month" entry_id="{repeet:entry_ids}" show_expired="yes" show_future_entries="yes" dynamic="off" }
{repeet:item}
{repeet:entry_id}{entry_id}{/repeet:entry_id}
{repeet:entry_date}{entry_date format="%Y-%m-%d %H:%i"}{/repeet:entry_date}
{repeet:expiration_date}{expiration_date format="%Y-%m-%d %H:%i"}{/repeet:expiration_date}
{repeet:interval}{event-repeat}{/repeet:interval}
{repeet:include_dates}{include-dates}{/repeet:include_dates}
{repeet:exclude_dates}{exclude-dates}{/repeet:exclude_dates}
{repeet:display}
<h3>{title}</h3>
{repeet:start_time format="%l, %M. %j%S"}{if expiration_date} to {expiration_date format="%l, %M. %j%S"}{/if}{if event-time}, {event-time}{/if}
{if event-description}{event-description}{/if}
{if event-forms}
<ul>
{event-forms}
<li><a href="http://{file_url}">{file_name}</a></li>
{/event-forms}
</ul>
{/if}
<hr >
{/repeet:display}
{/repeet:item}
{/exp:weblog:entries}
{/exp:repeet:get_ids}
{/exp:repeet:parse}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.