Week
Trait Week.
week and ISO week number, year and count in year.
Depends on the following properties:
Table of Contents
- $dayOfWeek : int
- $dayOfYear : int
- $daysInYear : int
- $year : int
- 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
Return values
void —copy()
public
static copy() : void
Return values
void —dayOfYear()
public
static dayOfYear(int $dayOfYear) : void
Parameters
- $dayOfYear : int
Return values
void —getTranslationMessage()
public
getTranslationMessage(string $key, string $locale = null, string $default = null, mixed $translator) : string
Parameters
- $key : string
- $locale = null : string
- $default = null : string
- $translator : mixed
Return values
string —isoWeek()
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()
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()
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()
public
static next(int $day) : void
Parameters
- $day : int
Return values
void —startOfWeek()
public
static startOfWeek(int $day = 1) : void
Parameters
- $day = 1 : int
Return values
void —subWeeks()
public
static subWeeks(int $weeks = 1) : void
Parameters
- $weeks = 1 : int
Return values
void —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|static —weeksInYear()
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()
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()
public
static year(int $year = null) : void
Parameters
- $year = null : int