See the date is not a given week in the year.

@param string $date
@param int    $week
178046
public function dontSeeWeekInYear($date, $week) {
        \PHPUnit_Framework_Assert::assertNotEquals($week, $this->_ParseDate($date)->weekOfYear);
    }
646610
protected function isValidDate($date)
    {
        $dt = DateTime::createFromFormat('Y-m-d', $date);

        return ($dt !== false && !array_sum($dt->getLastErrors()));
    }
1326442
public function seeDayInYear($date, $day) {
        \PHPUnit_Framework_Assert::assertEquals($day, $this->_ParseDate($date)->dayOfYear);
    }
1167028
public function dontSeeDayInWeek($date, $day) {
        \PHPUnit_Framework_Assert::assertNotEquals($day, $this->_ParseDate($date)->dayOfWeek);
    }
520303
public function dontSeeDateIsFriday($date) {
        \PHPUnit_Framework_Assert::assertFalse($this->_ParseDate($date)->dayOfWeek == Carbon::FRIDAY);
    }
692627
public function setISODate($year, $week, $day = 1) : \DateTime /*self invariant*/
    {
        if ($this->frozen) {
            throw new \RuntimeException(get_class($this) . ' is read-only, frozen.');
        }
        return parent::setIsoDate($year, $week, $day);
    }
1156563
public static DateTime offsetWeek(Date date, int offset) {
		return offset(date, DateField.WEEK_OF_YEAR, offset);
	}
62612
public static int getWeekOfDate(String date) {
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
		int week = 0;
		;
		Calendar c = Calendar.getInstance();
		try {
			c.setTime(formatter.parse(date));
			week = c.get(Calendar.WEEK_OF_YEAR);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return week;
	}
849449
protected function isLastWeek(DateTime $date)
    {
        $week = new DateTime('-7 days');

        if ($date->getTimestamp() <= time() && $date->getTimestamp() >= $week->getTimestamp()) {
            return true;
        }
        return false;
    }
1047966
public function diffInWeekdays($date = null, $absolute = true)
    {
        return $this->diffInDaysFiltered(function (CarbonInterface $date) {
            return $date->isWeekday();
        }, $date, $absolute);
    }
1245831
public function seeDateIsInDays($date, $days) {
        \PHPUnit_Framework_Assert::assertEquals($days, $this->_GetNow()->diffInDays($this->_ParseDate($date), false));
    }
313483
public function minusWeeks(int $weeks) : LocalDateTime
    {
        if ($weeks === 0) {
            return $this;
        }

        return new LocalDateTime($this->date->minusWeeks($weeks), $this->time);
    }
716112
public function setDateDelivery( $date )
	{
		if ( $date === $this->getDateDelivery() ) { return; }

		$this->_checkDateFormat($date);

		$this->_values['datedelivery'] = (string) $date;
		$this->setModified();
	}
738170
public static function isValidDate($date)
    {
        $d = $this->splitDate($date, 'int');
        if ($d['year'] > 0 && $d['month'] > 0 && $d['date'] > 0) {
            return checkdate($d['month'], $d['date'], $d['year']);
        } else {
            return false;
        }
    }
1075940
public function toDate($date)
	{
		$this->current = (is_string($date) ? new \DateTime($date, self::$utc) : $date);
	}
179025
public static function parseForumDate(string $date): ?\DateTimeImmutable
    {
        if (!preg_match('/\d{4}/', $date)) {
            $date .= ', '.date('Y');
        }

        return self::parseDate($date);
    }
1246794
public static function dateRangeInWeek($week = 0, $year = 0)
    {
        /*
          Fungsi ini untuk mendapatkan nilai tanggal berapa saja dalam minggu tertentu
          Tanggal dimulai pada hari senin pada minggu tersebut.
          returned type: array
         */
        $year = (int)$year;
        $week = (int)$week;
        if ($year < 1970) { // minimal unix time year 1970
            $year = date("Y");
            $week = date("W");
        }
        if ($week <= 0 || $week > 54) {
            $week = date("W");
            $year = date("Y");
        }
        //cek apakah tanggal 1 masuk minggu pertama atau minggu terakhir tahun sebelumnya
        $mingguTanggalAwalTahun   = date("W", mktime(1, 0, 0, 1, 1, $year));
        $jumlahDetikDalamSehari   = 24 * 60 * 60;
        $jumlahDetikDalamSeminggu = $jumlahDetikDalamSehari * 7;
        $hariAwalTahun            = date("w", mktime(1, 0, 0, 1, 1, $year));
        // Hari ke 0/7->minggu 1->Senin 2->Selasa 3->Rabu 4->Kamis 5->Jumat 6->Sabtu
        $detikAwalTahun = date("U", mktime(1, 0, 0, 1, 1, $year));
        if ($hariAwalTahun == 0) {
            $hariAwalTahun = 7; // ISO-8601 numeric representation
        }
        $jumlahHariPadaMingguPertama = (7 - $hariAwalTahun) + 1; //Long variable name but easily understood :P
        $detikTambahan               = (($week - 1) * $jumlahDetikDalamSeminggu) + ($jumlahHariPadaMingguPertama * $jumlahDetikDalamSehari);
        if ($mingguTanggalAwalTahun == 1) {
            $tanggalUnixSenin = $detikAwalTahun + $detikTambahan;
        } else {
            $tanggalUnixSenin = $detikAwalTahun + $detikTambahan + $jumlahDetikDalamSeminggu;
        }
        $dateRange = array();
        for ($i = 1; $i <= 7; $i++) {
            $dateRange[$i] = date("Y-m-d", ($tanggalUnixSenin + (($i - 1) * $jumlahDetikDalamSehari) - $jumlahDetikDalamSeminggu));
        }

        return $dateRange;
    }