Helper/Data.php
public function validateDateRange($dateFrom, $dateTo)
    {
        if (!$this->validateDate($dateFrom) || !$this->validateDate($dateTo)) {
            return 'From or To date is not a valid date.';
        }
        if (strtotime($dateFrom) > strtotime($dateTo)) {
            return 'To Date cannot be earlier then From Date.';
        }
        return false;
    }
public function validateDateRange($dateFrom, $dateTo)
    {
        if (!$this->validateDate($dateFrom) || !$this->validateDate($dateTo)) {
            return 'From or To date is not a valid date.';
        }
        if (strtotime($dateFrom) > strtotime($dateTo)) {
            return 'To Date cannot be earlier then From Date.';
        }
        return false;
    }
public function validateDateRange ( $ dateFrom , $ dateTo ) { if ( ! $ this -> validateDate ( $ dateFrom ) || ! $ this -> validateDate ( $ dateTo ) ) { return 'From or To date is not a valid date.' ; } if ( strtotime ( $ dateFrom ) > strtotime ( $ dateTo ) ) { return 'To Date cannot be earlier then From Date.' ; } return false ; }
Validate date range

@param string $dateFrom
@param string $dateTo
@return bool|string
Validate date range