Multi-Day Events showing same date
-
Hello, I decided to modify your plugin, because when it lists multi-day events from the feed, it basically shows only one date, the start or end date.
And even if you use the start-custom with an offset, there is NO way within shortcode syntax to provide an index by which to multiply by days , since the loop counter isn’t exposed.Therefore here is the code to permit it to properly list the day, when multiple days listing is enabled for multi-day events.
Shortcode syntax for post:
[if-multi-day] [start-custom format="M d, Y" offset="day_diff"] [/if-multi-day]
cool that’s easy right.So here’s the patched code:
includes/class-gce-feed.php Line #26, now is…
$feed_end,$multi_day_map=array();good stuff. Ok now the final mod:
includes/class-gce-event.php
line #295: if ($offset!=’day_diff’) $offset = intval( $offset );
And here’s the whole block for start-custom shortcode:case 'start-custom': if ($offset=='day_diff') { $length=$this->gce_human_time_diff( $this->start_time, $this->end_time, $precision ); $index=0; if (isset($this->feed->multi_day_map[$this->title])) { $index=$this->feed->multi_day_map[$this->title]; if ($index >= $length) $index=0; // in case object persists across page load else { $this->feed->multi_day_map[$this->title]++; $index=$this->feed->multi_day_map[$this->title]; } } else { $this->feed->multi_day_map[$this->title]=0; } $offset=(86400 * $index) +1; return $m[1].date_i18n($format,$this->start_time+$offset).$m[6]; } else { return $m[1] . date_i18n( $format, $this->start_time + $offset ) . $m[6]; }Now it displays the correct date for each event. Good day to you.
The topic ‘Multi-Day Events showing same date’ is closed to new replies.