Changeset 2578
- Timestamp:
- 02/24/2016 07:38:44 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/payment-requests-dashboard.php
r2576 r2578 584 584 585 585 echo 'Vendor Pay'; // Entry Description 586 echo date( 'ymd', s trtotime( 'today + 1 weekday') ); // Company Description Date587 echo date( 'ymd', s trtotime( 'today + 1 weekday') ); // Effective Entry Date586 echo date( 'ymd', self::_next_business_day_timestamp() ); // Company Description Date 587 echo date( 'ymd', self::_next_business_day_timestamp() ); // Effective Entry Date 588 588 echo str_pad( '', 3 ); // Blanks 589 589 echo '1'; // Originator Status Code … … 682 682 echo str_repeat( PHP_EOL, 10 - ( ( 4 + $count ) % 10 ) - 1 ); 683 683 return ob_get_clean(); 684 } 685 686 /** 687 * Exclude weekends and JPM holidays. 688 * 689 * Needs to be updated every year. 690 * 691 * @return int Timestamp. 692 */ 693 private static function _next_business_day_timestamp() { 694 static $timestamp; 695 696 if ( isset( $timestamp ) ) 697 return $timestamp; 698 699 $holidays = array( 700 date( 'Ymd', strtotime( 'Friday, January 1, 2016' ) ), 701 date( 'Ymd', strtotime( 'Monday, January 18, 2016' ) ), 702 date( 'Ymd', strtotime( 'Monday, February 15, 2016' ) ), 703 date( 'Ymd', strtotime( 'Monday, May 30, 2016' ) ), 704 date( 'Ymd', strtotime( 'Monday, July 4, 2016' ) ), 705 date( 'Ymd', strtotime( 'Monday, September 5, 2016' ) ), 706 date( 'Ymd', strtotime( 'Friday, November 11, 2016' ) ), 707 date( 'Ymd', strtotime( 'Thursday, November 24, 2016' ) ), 708 date( 'Ymd', strtotime( 'Monday, December 26, 2016' ) ), 709 ); 710 711 $timestamp = strtotime( 'today + 1 weekday' ); 712 $attempts = 5; 713 714 while ( in_array( date( 'Ymd', $timestamp ), $holidays ) ) { 715 $timestamp = strtotime( '+ 1 weekday', $timestamp ); 716 $attempts--; 717 718 if ( ! $attempts ) 719 break; 720 } 721 722 return $timestamp; 684 723 } 685 724
Note: See TracChangeset
for help on using the changeset viewer.