/** * * @param string $modify * @return type */ public function modify($modify) { if ($modify == 'midnight' || $modify == 'today') { return $this->setTime(0, 0, 0); //fix for linux } if ($this->isRelative($modify) && $this->isSunday()) { parent::modify('-1 week'); } $res = parent::modify($modify); return $res; }