code: protected function compare($a, $b)
       {
          $key = $this->sortKey;
          $aValue = $this->getValue($a, $key);
          $bValue = $this->getValue($b, $key);
          echo $aValue->format('m/d/Y')." - ".$bValue->format('m/d/Y')." = ";
          if ($aValue == $bValue) {
              echo '0<br>';
              return 0;
          }
          if (strtolower($this->sortDirection) == 'desc') {
              echo (($aValue < $bValue) ? -1 : 1)."<br>";
              return ($aValue < $bValue) ? -1 : 1;
          }
          else {
              echo (($aValue < $bValue) ? 1 : -1)."<br>";
              return ($aValue < $bValue) ? 1 : -1;
          }
       }
docs: A simple compare function which is used by the Sort method.
  
  @param $a Mixed
  @param $b Mixed
  @return boolean