(re)sets the ISO date

@param  int  $year   Year
@param  int  $week   Week
@param  int  $day    Offset of the first day of the week, base 1

@return bool|Date  this object, or false on failure
767306
public function setISODate($year, $week, $day = 1)
	{
		if ($this->datetime->setISODate($year, $week, $day))
		{
			return $this;
		}

		return false;
	}
943951
public function set(int $day, int $month, int $year)
    {
        $validator = new DateValidator($day, $month, $year);

        if (!$validator->isValid()) {
            throw new InvalidDateException();
        }

        $this->day = $day;
        $this->month = $month;
        $this->year = $year;

        $this->jdn = (int) static::process($day, $month, $year);

        return $this;
    }
912647
public function withDateAt(int $year = null, int $month = null, int $day = null) : self
    {
        if (null === $year && null === $month && null === $day) {
            return $this;
        }
        
        $year  = $year === null ? $this->year() : $year;
        $month = $month ?: $this->month();
        $day   = $day   ?: $this->day();
        
        $instance = clone $this;
        
        $instance->date->setDate($year, $month, $day);
        
        return $instance;
    }
1289405
public static function of(int $year, int $week) : YearWeek
    {
        Field\Year::check($year);
        Field\WeekOfYear::check($week, $year);

        return new YearWeek($year, $week);
    }
312309
public function byYears(int $years): Date
    {
        return $this->yearTo($this->originalDate->year() + $years);
    }
1246558
function setYear( $year )
    {
        $arr = getdate( $this->DateTime );
        $this->DateTime = mktime( $arr['hours'], $arr['minutes'], $arr['seconds'],
                                  $arr['mon'], $arr['mday'], $year );
    }
709837
public function set_joursferies($year)
    {
        $this->joursferies = [];
        $this->joursferies["${year}0101"] = true;
        $this->joursferies["${year}0501"] = true;
        $this->joursferies["${year}0508"] = true;
        $this->joursferies["${year}0714"] = true;
        $this->joursferies["${year}0815"] = true;
        $this->joursferies["${year}1101"] = true;
        $this->joursferies["${year}1111"] = true;
        $this->joursferies["${year}1225"] = true;
        
        //Timestamp du dimanche de paques
        $this->ts_easter = self::get_easter_date($year);
        
        //Lundi de paques
        $ts_feriers = $this->ts_easter + 1 * self::$TIME2SEC['d'];
        $aaaammdd_ferie = date('Ymd', $ts_feriers);
        $this->joursferies["$aaaammdd_ferie"] = true;
        
        //Jeudi de l'Ascension
        $ts_feriers = $this->ts_easter + 39 * self::$TIME2SEC['d'];
        $aaaammdd_ferie = date('Ymd', $ts_feriers);
        $this->joursferies["$aaaammdd_ferie"] = true;
        
        //Lundi de Pentecote
        $ts_feriers = $this->ts_easter + 50 * self::$TIME2SEC['d'];
        $aaaammdd_ferie = date('Ymd', $ts_feriers);
        $this->joursferies["$aaaammdd_ferie"] = true;
        
        return $this;
    }
604860
public function setEndDate(int $day, int $month, int $year): self
    {
        $this->endDate = [$day, $month, $year];

        return $this;
    }
298357
public static function check(int $dayOfYear, int $year = null) : void
    {
        if ($dayOfYear < 1 || $dayOfYear > 366) {
            throw DateTimeException::fieldNotInRange(self::NAME, $dayOfYear, 1, 366);
        }

        if ($dayOfYear === 366 && $year !== null && ! Year::isLeap($year)) {
            throw new DateTimeException("Invalid day-of-year 366 as $year is not a leap year");
        }
    }
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;
    }
378603
public static function firstSundayOfYear($year = null)
    {
        $year = $year ? (int) $year : Date('Y');
        $sunday = Carbon::parse($year . '-01-01')->startOfWeek(Carbon::SUNDAY);
        return ((int) $sunday->format('Y') === $year) ? $sunday : $sunday->addDays(7);
    }
676845
public static function isLeapYear($year)
    {
        if (preg_match('/\D/', $year)) {
            return false;
        }
        if ($year < 1000) {
            return false;
        }
        if ($year < 1582) {
            // pre Gregorio XIII - 1582
            return ($year % 4 == 0);
        } else {
            // post Gregorio XIII - 1582
            return (($year % 4 == 0) && ($year % 100 != 0)) || ($year % 400 == 0);
        }
    }
897903
public function setDate($year, $month, $day)
    {
        return parent::setDate(self::$yearMustAlwaysBe, self::$monthMustAlwaysBe, self::$dayMustAlwaysBe);
    }
1195633
public static function nextWeek($week, $year)
    {
        if ($year >= 1970) {
            $maxWeek = (int)date("W", mktime(1, 0, 0, 12, 31, $year));
            if ($maxWeek == 1) { // tanggal 31 desember bukan hari minggu dianggap minggu 1 tahun berikutnya
                $detikSeminggu = 7 * 24 * 60 * 60;
                $maxWeek       = (int)date("W", (mktime(1, 0, 0, 12, 31, $year) - $detikSeminggu));
            }
            if ($week >= $maxWeek) {
                $nextWeek = 1;
                $yearWeek = $year + 1;
            } else {
                $nextWeek = $week + 1;
                $yearWeek = $year;
            }
        }

        return array('week' => $nextWeek, 'year' => $yearWeek);
    }
283193
public function withYear(int $year) : ZonedDateTime
    {
        return ZonedDateTime::of($this->localDateTime->withYear($year), $this->timeZone);
    }
1111941
public function setDate($year, $month, $day)
    {
        if($this->_date->setDate($year, $month, $day) === false) {
            return false;
        }

        return $this;
    }
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);
    }