src/Peach/DT/Date.php
protected function compareFields(Time $time)
    {
        $className = __CLASS__;
        if ($time instanceof $className) {
            if ($this->year  !== $time->year) {
                return $this->year  - $time->year;
            }
            if ($this->month !== $time->month) {
                return $this->month - $time->month;
            }
            if ($this->date  !== $time->date) {
                return $this->date  - $time->date;
            }
            return 0;
        }
        else {
            $y = $time->get("year");
            $m = $time->get("month");
            $d = $time->get("date");
            if ($this->year  !== $y) {
                return (isset($y) ? $this->year  - $y : 0);
            }
            if ($this->month !== $m) {
                return (isset($m) ? $this->month - $m : 0);
            }
            if ($this->date  !== $d) {
                return (isset($d) ? $this->date  - $d : 0);
            }
            return 0;
        }
    }
protected function compareFields(Time $time)
    {
        $className = __CLASS__;
        if ($time instanceof $className) {
            if ($this->year  !== $time->year) {
                return $this->year  - $time->year;
            }
            if ($this->month !== $time->month) {
                return $this->month - $time->month;
            }
            if ($this->date  !== $time->date) {
                return $this->date  - $time->date;
            }
            return 0;
        }
        else {
            $y = $time->get("year");
            $m = $time->get("month");
            $d = $time->get("date");
            if ($this->year  !== $y) {
                return (isset($y) ? $this->year  - $y : 0);
            }
            if ($this->month !== $m) {
                return (isset($m) ? $this->month - $m : 0);
            }
            if ($this->date  !== $d) {
                return (isset($d) ? $this->date  - $d : 0);
            }
            return 0;
        }
    }
この時間と指定された時間を比較します.

この型の時間フィールドと引数の型の時間フィールドのうち,
共通しているフィールド同士を比較します.

引数が Peach_DT_Date を継承したオブジェクトではない場合,
引数のオブジェクトに対して get("year"), get("month"), get("date") の返り値を比較対象のフィールドとします.

@param  Time 比較対象の時間
@return int  この時間のほうが過去の場合は負の値, 未来の場合は正の値, 等しい場合は 0
@ignore