calculate_current_range() public method

Get the current range and calculate the start and end dates.
public calculate_current_range ( string $current_range )
$current_range string
 /**
  * Setup the report object and parse any date filtering.
  *
  * @param array $filter date filtering
  */
 protected function setup_report($filter)
 {
     include_once WC()->plugin_path() . '/includes/admin/reports/class-wc-admin-report.php';
     include_once WC()->plugin_path() . '/includes/admin/reports/class-wc-report-sales-by-date.php';
     $this->report = new WC_Report_Sales_By_Date();
     if (empty($filter['period'])) {
         // Custom date range.
         $filter['period'] = 'custom';
         if (!empty($filter['date_min']) || !empty($filter['date_max'])) {
             // Overwrite _GET to make use of WC_Admin_Report::calculate_current_range() for custom date ranges.
             $_GET['start_date'] = $filter['date_min'];
             $_GET['end_date'] = isset($filter['date_max']) ? $filter['date_max'] : null;
         } else {
             // Default custom range to today.
             $_GET['start_date'] = $_GET['end_date'] = date('Y-m-d', current_time('timestamp'));
         }
     } else {
         $filter['period'] = empty($filter['period']) ? 'week' : $filter['period'];
         // Change "week" period to "7day".
         if ('week' === $filter['period']) {
             $filter['period'] = '7day';
         }
     }
     $this->report->calculate_current_range($filter['period']);
 }