Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter yunnnn

    (@yunnnn)

    Hi all,

    With regards to fix no 2, there are some issues with the original fix and I’ve placed a new one instead.

    2. Month View does not display Prev/Next month correctly on last day of month

    Replace the entire nextMonth and previousMonth function in /the-events-calendar/lib/the-events-calendar.class.php

    /**
    		 * Given a date (YYYY-MM-DD), returns the first of the next month
    		 * hat tip to Dan Bernadict for method cleanup
    		 *
    		 * @param date
    		 * @return date
    		 */
    		public function nextMonth( $date ) {
    			list($year, $month) = explode("-", $date);
    			$date = $year . "-" . $month . "-01";
    			return date( 'Y-m', strtotime( $date . ' +1 month' ) );
    		}
    
    		/**
    		 * Given a date (YYYY-MM-DD), return the first of the previous month
    		 * hat tip to Dan Bernadict for method cleanup
    		 *
    		 * @param date
    		 * @return date
    		 */
    		public function previousMonth( $date ) {
    			list($year, $month) = explode("-", $date);
    			$date = $year . "-" . $month . "-01";
    			return date( 'Y-m', strtotime( $date . ' -1 month' ) );
    		}

    Can’t seem to edit the original post anymore, so here’s a new post instead.

    Also, I’ve noticed that the order in list view is messed up after you click on “Previous Events” then “Next Events”…I’ll be looking into this and placing a fix here soon.

    Cheers.

    Thread Starter yunnnn

    (@yunnnn)

    @justin, try this. I haven’t tested it so I’m not sure if it’ll work or not, but I think this is probably the cause.

    Go to /the-events-calendar/lib/tribe-event-query.class.php

    Find

    ( $record_start >= $start_of_day && $record_start < $end_of_day )

    Replace with

    ( $record_start >= $start_of_day && $record_start <= $end_of_day )

    If that doesn’t work, I’ll have to look into it some other time when I’m free (since it doesn’t affect me yet).

Viewing 2 replies - 1 through 2 (of 2 total)