Ticket #30845: 30845.patch
| File 30845.patch, 798 bytes (added by , 11 years ago) |
|---|
-
src/wp-includes/date.php
336 336 ); 337 337 338 338 // Weeks per year. 339 if ( array_key_exists( 'year', $date_query ) ) { 340 // If we have a specific year, use it to calculate number of weeks. 341 $date = new DateTime(); 342 $date->setISODate( $date_query['year'], 53 ); 343 $week_count = $date->format( "W" ) === "53" ? 53 : 52; 344 345 } else { 346 // Otherwise set the week-count to a maximum of 53. 347 $week_count = 53; 348 } 349 339 $week_count = (array_key_exists('year', $date_query) ? date('W',mktime(0,0,0,12,28,$date_query['year'])) : 53); 350 340 $min_max_checks['week'] = array( 351 341 'min' => 1, 352 342 'max' => $week_count