| @@ 700-729 (lines=30) @@ | ||
| 697 | } |
|
| 698 | break; |
|
| 699 | ||
| 700 | case 'this_quarter' : |
|
| 701 | $month_now = date( 'n', $current_time ); |
|
| 702 | ||
| 703 | if ( $month_now <= 3 ) { |
|
| 704 | ||
| 705 | $dates['m_start'] = 1; |
|
| 706 | $dates['m_end'] = 4; |
|
| 707 | $dates['year'] = date( 'Y', $current_time ); |
|
| 708 | ||
| 709 | } else if ( $month_now <= 6 ) { |
|
| 710 | ||
| 711 | $dates['m_start'] = 4; |
|
| 712 | $dates['m_end'] = 7; |
|
| 713 | $dates['year'] = date( 'Y', $current_time ); |
|
| 714 | ||
| 715 | } else if ( $month_now <= 9 ) { |
|
| 716 | ||
| 717 | $dates['m_start'] = 7; |
|
| 718 | $dates['m_end'] = 10; |
|
| 719 | $dates['year'] = date( 'Y', $current_time ); |
|
| 720 | ||
| 721 | } else { |
|
| 722 | ||
| 723 | $dates['m_start'] = 10; |
|
| 724 | $dates['m_end'] = 1; |
|
| 725 | $dates['year'] = date( 'Y', $current_time ); |
|
| 726 | $dates['year_end'] = date( 'Y', $current_time ) + 1; |
|
| 727 | ||
| 728 | } |
|
| 729 | break; |
|
| 730 | ||
| 731 | case 'last_quarter' : |
|
| 732 | $month_now = date( 'n' ); |
|
| @@ 731-760 (lines=30) @@ | ||
| 728 | } |
|
| 729 | break; |
|
| 730 | ||
| 731 | case 'last_quarter' : |
|
| 732 | $month_now = date( 'n' ); |
|
| 733 | ||
| 734 | if ( $month_now <= 3 ) { |
|
| 735 | ||
| 736 | $dates['m_start'] = 10; |
|
| 737 | $dates['m_end'] = 12; |
|
| 738 | $dates['year'] = date( 'Y', $current_time ) - 1; // Previous year |
|
| 739 | $dates['year_end'] = date( 'Y', $current_time ) - 1; // Previous year |
|
| 740 | ||
| 741 | } else if ( $month_now <= 6 ) { |
|
| 742 | ||
| 743 | $dates['m_start'] = 1; |
|
| 744 | $dates['m_end'] = 3; |
|
| 745 | $dates['year'] = date( 'Y', $current_time ); |
|
| 746 | ||
| 747 | } else if ( $month_now <= 9 ) { |
|
| 748 | ||
| 749 | $dates['m_start'] = 4; |
|
| 750 | $dates['m_end'] = 6; |
|
| 751 | $dates['year'] = date( 'Y', $current_time ); |
|
| 752 | ||
| 753 | } else { |
|
| 754 | ||
| 755 | $dates['m_start'] = 7; |
|
| 756 | $dates['m_end'] = 9; |
|
| 757 | $dates['year'] = date( 'Y', $current_time ); |
|
| 758 | ||
| 759 | } |
|
| 760 | break; |
|
| 761 | ||
| 762 | case 'this_year' : |
|
| 763 | $dates['m_start'] = 1; |
|