Changeset 6952
- Timestamp:
- 03/28/2018 05:01:24 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-meeting-posttype/wporg-meeting-posttype.php
r5851 r6952 122 122 try { 123 123 // from the start date, advance the week until it's past now 124 $start = new DateTime( $post->start_date . ' ' . $post->time . ' GMT');124 $start = new DateTime( sprintf( '%s %s GMT', $post->start_date, $post->time ) ); 125 125 $next = $start; 126 126 $now = new DateTime(); … … 141 141 try { 142 142 // advance the start date 2 weeks at a time until it's past now 143 $start = new DateTime( $post->start_date . ' ' . $post->time . ' GMT');143 $start = new DateTime( sprintf( '%s %s GMT', $post->start_date, $post->time ) ); 144 144 $next = $start; 145 145 $now = new DateTime(); … … 157 157 try { 158 158 // advance the occurrence day in the current month until it's past now 159 $start = new DateTime( $post->start_date . ' ' . $post->time . ' GMT');159 $start = new DateTime( sprintf( '%s %s GMT', $post->start_date, $post->time ) ); 160 160 $next = $start; 161 161 $now = new DateTime(); 162 162 163 $day_index = date( 'w', strtotime( $post->start_date . ' ' . $post->time . ' GMT') );163 $day_index = date( 'w', strtotime( sprintf( '%s %s GMT', $post->start_date, $post->time ) ) ); 164 164 $day_name = $GLOBALS['wp_locale']->get_weekday( $day_index ); 165 165 $numerals = array( 'first', 'second', 'third', 'fourth' ); … … 168 168 foreach ( $post->occurrence as $index ) { 169 169 foreach ( $months as $month ) { 170 $next = new DateTime( $numerals[ $index - 1 ] . ' ' . $day_name . ' of ' . $month);170 $next = new DateTime( sprintf( '%s %s of %s %s GMT', $numerals[ $index - 1 ], $day_name, $month, $post->time ) ); 171 171 if ( $next > $now ) { 172 172 break 2; … … 183 183 try { 184 184 // advance the start date 1 month at a time until it's past now 185 $start = new DateTime( $post->start_date . ' ' . $post->time . ' GMT');185 $start = new DateTime( sprintf( '%s %s GMT', $post->start_date, $post->time ) ); 186 186 $next = $start; 187 187 $now = new DateTime();
Note: See TracChangeset
for help on using the changeset viewer.