protected function dueFactor()
    {
        $date = \DateTime::createFromFormat('Y-m-d', $this->title->due);
        $epoch = new \DateTime('1997-10-07');
        if ($date && $date > $epoch) {
            $diff = substr($date->diff($epoch)->format('%a'), -4);
            return str_pad($diff, 4, '0', STR_PAD_LEFT);
        }
        return '0000';
    }
protected function dueFactor()
    {
        $date = \DateTime::createFromFormat('Y-m-d', $this->title->due);
        $epoch = new \DateTime('1997-10-07');
        if ($date && $date > $epoch) {
            $diff = substr($date->diff($epoch)->format('%a'), -4);
            return str_pad($diff, 4, '0', STR_PAD_LEFT);
        }
        return '0000';
    }
protected function dueFactor ( ) { $ date = \ DateTime :: createFromFormat ( 'Y-m-d' , $ this -> title -> due ) ; $ epoch = new \ DateTime ( '1997-10-07' ) ; if ( $ date && $ date > $ epoch ) { $ diff = substr ( $ date -> diff ( $ epoch ) -> format ( '%a' ) , - 4 ) ; return str_pad ( $ diff , 4 , '0' , STR_PAD_LEFT ) ; } return '0000' ; }
Calculate the amount of days since 1997-10-07

@return string Four digits
Calculate the amount of days since 1997 - 10 - 07