Jump to content

Search the Community

Showing results for tags 'past'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hello everyone My question is very noobish, but I found no way to accomplish something simple. Also related posts in the forum where to difficult to work with for me … I would like to sort upcoming and past events which are repeaters by their end date field. The output should look something like this: UPCOMING EVENTS Title event 1 26. November to 27. November 2014 Title event 2 29. November 2014 … PAST EVENTS Title event 3 12. November 2014 Title event 4 1. August to 5. August 2014 … My code only returns the last of the created events as many times as there are events . Am I completely on the wrong way? Any hint would be very appreciated … Thanks, tron1000 setlocale(LC_TIME, 'de_DE'); echo "<h1>Events</h1>"; foreach($page->event as $event) { $event_title = $event->event_title; $date_to = $event->getUnformatted('event_date_to'); $today = time(); $date_from_formatted = strftime('%d. %B %Y', $event->getUnformatted('event_date_from')); $date_to_formatted = strftime('%d. %B %Y', $event->getUnformatted('event_date_to')); if ($date_from_formatted == $date_to_formatted) $event_out = "{$event_title}<br>{$date_from_formatted}<br><br>"; else $event_out = "{$event_title}<br>{$date_from_formatted} to {$date_to_formatted}<br><br>"; } echo "UPCOMING<br><br>"; if ($date_to > $today) foreach($page->event as $event) { echo $event_out; } echo "PAST<br><br>"; if ($date_to < $today) foreach($page->event as $event) { echo $event_out; }
×
×
  • Create New...