Skip to content

Commit

Permalink
Do not modify returned value. Use a cloned pointer. Fixes #159.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenharris committed Nov 1, 2013
1 parent 3b70704 commit e2e50c0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions classes/class-eo-calendar-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,12 @@ static function generate_output( $month, $args = array() ){

$start = eo_get_the_start( DATETIMEOBJ, $event->ID, null, $event->occurrence_id );
$end = eo_get_the_end( DATETIMEOBJ, $event->ID, null, $event->occurrence_id );

while( $start <= $end ){
$date = eo_format_datetime( $start, 'Y-m-d' );
$pointer = clone $start;

while( $pointer <= $end ){
$date = eo_format_datetime( $pointer, 'Y-m-d' );
$calendar_events[ $date ][] = $event;
$start->modify( '+1 day' );
$pointer->modify( '+1 day' );
}

}else{
Expand Down

2 comments on commit e2e50c0

@drblue
Copy link

@drblue drblue commented on e2e50c0 Nov 1, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfectly, thanks :D

@stephenharris
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming that! I'll be in 2.4.1 (I shall hold out for a few more days to catch any other bugs that might come to light...)

Please sign in to comment.