Forums / General / Show "events" between two dates

Show "events" between two dates

Author Message

Steph A

Wednesday 02 November 2005 4:41:26 am

I have a class called "event" with two date attributes - "event_start" and "event_stop".

http://ez.no/community/forum/general/show_events_for_the_next_x_days

But I would like to take this template further. I would like to have the users themself define a "start_date" and a "stop_date", and then show them the events in between those dates.

Any ideas to achive this?

(Iam still quite a newbie, but trying to learn :)

...any help would be deeply appreciated

{let timestamp=maketime()
     current=gettime($timestamp)
     x=5
     start = maketime( 0, 0, 0, $current.month, $current.day, $current.year )
     end = maketime( 23, 59, 59, $current.month, $current.day|sum( $x ), $current.year )
     events = fetch( 'content', 'list',
         hash(
               'parent_node_id', $node.node_id,
               'attribute_filter', array(
                       'or',
                       array( 'event/event_start', 'between', array( $start, $end ) ),
                       array( 'event/event_end', 'between', array( $start, $end ) )
                    )
              )
            )
}
{foreach $events as $event}
    {node_view_gui view='line' content_node=$event}
{/foreach}
{/let}