Sets a date by ISO-8601 conform data.

@param  integer $year The year
@param  integer $week The Week number (Weeks begins at monday)
@param  integer $day  The day
@return \Beluga\Date\DateTime
4327
public function setISODate( $year, $week, $day = null )
      : DateTime
   {

      parent::setISODate( $year, $week, $day );

      return $this;

   }
178046
public function dontSeeWeekInYear($date, $week) {
        \PHPUnit_Framework_Assert::assertNotEquals($week, $this->_ParseDate($date)->weekOfYear);
    }
182484
def _iso_to_gregorian(iso_year, iso_week, iso_day):
    ""
    year_start = _iso_year_start(iso_year)
    return year_start + dt.timedelta(days=iso_day-1, weeks=iso_week-1)
313483
public function minusWeeks(int $weeks) : LocalDateTime
    {
        if ($weeks === 0) {
            return $this;
        }

        return new LocalDateTime($this->date->minusWeeks($weeks), $this->time);
    }
394177
public function weeksAndDays($weeks, $days)
    {
        $this->dayz = ($weeks * Carbon::DAYS_PER_WEEK) + $days;

        return $this;
    }
610861
public static function is53WeekYear(int $year) : bool
    {
        $date = LocalDate::of($year, 1, 1);
        $dayOfWeek = $date->getDayOfWeek();

        return $dayOfWeek->is(DayOfWeek::THURSDAY)
            || ($dayOfWeek->is(DayOfWeek::WEDNESDAY) && $date->isLeapYear());
    }
460290
public static function addDays($date, $days) {
        if (Validator::isDateTime($date) === false) throw new InvalidArgumentException('Invalid argument $date: '.$date);
        if (!is_int($days))                         throw new IllegalTypeException('Illegal type of parameter $days: '.gettype($days));

        $parts = explode('-', $date);
        $year  = (int) $parts[0];
        $month = (int) $parts[1];
        $day   = (int) $parts[2];

        return date('Y-m-d', mktime(0, 0, 0, $month, $day+$days, $year));
    }
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);
    }
22991
public function plusWeeks(int $weeks) : YearWeek
    {
        if ($weeks === 0) {
            return $this;
        }

        $mondayOfWeek = $this->atDay(DayOfWeek::MONDAY)->plusWeeks($weeks);

        return $mondayOfWeek->getYearWeek();
    }
620006
public function setDate($year, $month, $day) : \DateTime /*self invariant*/
    {
        if ($this->frozen) {
            throw new \RuntimeException(get_class($this) . ' is read-only, frozen.');
        }
        return parent::setDate($year, $month, $day);
    }
786852
public static function prevWeek($week, $year)
    {
        if ($year >= 1970) {
            if ($week > 1) {
                $prevWeek = $week - 1;
                $yearWeek = $year;
            } else {
                $maxWeek = (int)date("W", mktime(1, 0, 0, 12, 31, $year - 1));
                if ($maxWeek == 1) { // tanggal 31 desember bukan hari minggu dianggap minggu 1 tahun berikutnya
                    $detikSeminggu = 7 * 24 * 60 * 60;
                    $prevWeek      = (int)date("W", (mktime(1, 0, 0, 12, 31, $year) - $detikSeminggu));
                } else {
                    $prevWeek = date("W", mktime(1, 0, 0, 12, 31, $year - 1));
                }
                $yearWeek = $year - 1;
            }
        }

        return array('week' => $prevWeek, 'year' => $yearWeek);
    }
274604
public static function firstWeekOfYear($year = null)
    {
        $year = $year ? (int) $year : Date('Y');
        return Carbon::parse($year . '-01-01')->startOfWeek(Carbon::SUNDAY);
    }
19927
public static function year($year = null)
	{
		$from = DateTime::create(1, 1, $year);
		$till = $from->copy()->addYears(1)->addDays(-1);
		return new Calendar($from, $till);
	}
255146
public function setDate($year, $month, $day) {
		$this->set("$year/$month/$day ".$this->format('HH:mm:ss'), null, 'yyyy/MM/dd HH:mm:ss');
		return $this;
	}
303203
private static int getFirstCalendarWeekAsDayOfYear(int year) {

        Weekday wdNewYear =
            Weekday.valueOf(GregorianMath.getDayOfWeek(year, 1, 1));
        int dow = wdNewYear.getValue(Weekmodel.ISO);

        return (
            (dow <= 8 - Weekmodel.ISO.getMinimalDaysInFirstWeek())
            ? 2 - dow
            : 9 - dow
        );

    }
690685
def iso_to_gregorian(iso_year, iso_week, iso_day):
    ""
    year_start = iso_year_start(iso_year)
    return year_start + datetime.timedelta(days=iso_day - 1, weeks=iso_week - 1)
674269
public function weeksAndDays($weeks, $days)
    {
        $this->dayz = ($weeks * Date::DAYS_PER_WEEK) + $days;

        return $this;
    }