Last active
March 31, 2016 21:16
-
-
Save Pebblo/f4d151e4784c6aa67a3d to your computer and use it in GitHub Desktop.
An example of how to pull an array of datetimes assigned to an event, resetting the $datetimes so that $datetime contains the next upcoming datetime for that event.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Pull a list of upcoming datetimes from the event and reset the array to return the first (next upcoming) | |
EE_Registry::instance()->load_helper('Event_View'); | |
$event = EEH_Event_View::get_event(); | |
$datetimes = $event->datetimes_ordered($show_expired = FALSE, $show_deleted = FALSE); | |
$datetime = reset($datetimes); | |
//echo the day | |
$datetime->e_start_date('d'); | |
//echo the month | |
$datetime->e_start_date('M'); | |
//echo the year | |
$datetime->e_start_date('Y'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment