Week
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
public
int
$dayOfWeek
$dayOfYear
public
int
$dayOfYear
$daysInYear
public
int
$daysInYear
$year
public
int
$year
Depends on the following methods:
Methods
addWeeks()
public
static addWeeks(int $weeks = 1) : void
Parameters
- $weeks = 1 : int
copy()
public
static copy() : void
dayOfYear()
public
static dayOfYear(int $dayOfYear) : void
Parameters
- $dayOfYear : int
getTranslationMessage()
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
stringisoWeek()
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|staticisoWeeksInYear()
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
intisoWeekYear()
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|staticnext()
public
static next(int|string $modifier = null) : void
Parameters
- $modifier = null : int|string
startOfWeek()
public
static startOfWeek(int $day = null) : void
Parameters
- $day = null : int
subWeeks()
public
static subWeeks(int $weeks = 1) : void
Parameters
- $weeks = 1 : int
week()
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|staticweeksInYear()
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
intweekYear()
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|staticyear()
public
static year(int $year = null) : void
Parameters
- $year = null : int