Menu

## Week

Week.php : 41

Trait Week.

week and ISO week number, year and count in year.

Depends on the following properties:

### Table of Contents

#### Properties

$dayOfWeek : int
$dayOfYear : int
$daysInYear : int
$year : int

#### Methods

addWeeks() : void
copy() : void
dayOfYear() : void
getTranslationMessage() : string
isoWeek() : int|static
  Get/set the week number using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.
isoWeeksInYear() : int
  Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.
isoWeekYear() : int|static
  Set/get the week number of year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.
next() : void
startOfWeek() : void
subWeeks() : void
week() : int|static
  Get/set the week number using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).
weeksInYear() : int
  Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).
weekYear() : int|static
  Set/get the week number of year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).
year() : void

### Properties

#### $dayOfWeek

Week.php : 0
`public int $dayOfWeek`

#### $dayOfYear

Week.php : 0
`public int $dayOfYear`

#### $daysInYear

Week.php : 0
`public int $daysInYear`

#### $year

Week.php : 0
`public int $year`

Depends on the following methods:

### Methods

#### addWeeks()

Week.php : 0
`public static addWeeks(int $weeks = 1) : void`

##### Parameters

$weeks = 1 : int

#### copy()

Week.php : 0
`public static copy() : void`

#### dayOfYear()

Week.php : 0
`public static dayOfYear(int $dayOfYear) : void`

##### Parameters

$dayOfYear : int

#### getTranslationMessage()

Week.php : 0
`public getTranslationMessage(string $key, string|null $locale = null, string|null $default = null, mixed $translator) : string`

##### Parameters

$key : string
$locale = null : string|null
$default = null : string|null
$translator : mixed

##### Return values

string

#### isoWeek()

Week.php : 215

Get/set the week number using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.

`public isoWeek([int|null $week = null ][, int|null $dayOfWeek = null ][, int|null $dayOfYear = null ]) : int|static`

##### Parameters

$week : int|null = null
$dayOfWeek : int|null = null
$dayOfYear : int|null = null

##### Return values

int|static

#### isoWeeksInYear()

Week.php : 134

Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.

`public isoWeeksInYear([int|null $dayOfWeek = null ][, int|null $dayOfYear = null ]) : int`

##### Parameters

$dayOfWeek : int|null = null

  first date of week from 0 (Sunday) to 6 (Saturday)

$dayOfYear : int|null = null

  first day of year included in the week #1

##### Return values

int

#### isoWeekYear()

Week.php : 54

Set/get the week number of year using given first day of week and first day of year included in the first week. Or use ISO format if no settings given.

`public isoWeekYear([int|null $year = null ][, int|null $dayOfWeek = null ][, int|null $dayOfYear = null ]) : int|static`

##### Parameters

$year : int|null = null

  if null, act as a getter, if not null, set the year and return current instance.

$dayOfWeek : int|null = null

  first date of week from 0 (Sunday) to 6 (Saturday)

$dayOfYear : int|null = null

  first day of year included in the week #1

##### Return values

int|static

#### next()

Week.php : 0
`public static next(int|string $modifier = null) : void`

##### Parameters

$modifier = null : int|string

#### startOfWeek()

Week.php : 0
`public static startOfWeek(int $day = null) : void`

##### Parameters

$day = null : int

#### subWeeks()

Week.php : 0
`public static subWeeks(int $weeks = 1) : void`

##### Parameters

$weeks = 1 : int

#### week()

Week.php : 182

Get/set the week number using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).

`public week([int|null $week = null ][, int|null $dayOfWeek = null ][, int|null $dayOfYear = null ]) : int|static`

##### Parameters

$week : int|null = null
$dayOfWeek : int|null = null
$dayOfYear : int|null = null

##### Return values

int|static

#### weeksInYear()

Week.php : 152

Get the number of weeks of the current week-year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).

`public weeksInYear([int|null $dayOfWeek = null ][, int|null $dayOfYear = null ]) : int`

##### Parameters

$dayOfWeek : int|null = null

  first date of week from 0 (Sunday) to 6 (Saturday)

$dayOfYear : int|null = null

  first day of year included in the week #1

##### Return values

int

#### weekYear()

Week.php : 74

Set/get the week number of year using given first day of week and first day of year included in the first week. Or use US format if no settings given (Sunday / Jan 6).

`public weekYear([int|null $year = null ][, int|null $dayOfWeek = null ][, int|null $dayOfYear = null ]) : int|static`

##### Parameters

$year : int|null = null

  if null, act as a getter, if not null, set the year and return current instance.

$dayOfWeek : int|null = null

  first date of week from 0 (Sunday) to 6 (Saturday)

$dayOfYear : int|null = null

  first day of year included in the week #1

##### Return values

int|static

#### year()

Week.php : 0
`public static year(int $year = null) : void`

##### Parameters

$year = null : int

## Search results