trait Week

Trait Week.

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

Depends on the following properties:

Properties

int $daysInYear
int $dayOfWeek
int $dayOfYear
int $year Depends on the following methods:

Methods

int|Week
isoWeekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

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.

int|Week
weekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

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).

int
isoWeeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)

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.

int
weeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)

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).

int|Week
week(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

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).

int|Week
isoWeek(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

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.

static
addWeeks(int $weeks =1)

No description

static
copy()

No description

static
dayOfYear(int $dayOfYear)

No description

string
getTranslationMessage(string $key,$translator =null)

No description

static
next(int|string $day =null)

No description

static
startOfWeek(int $day =1)

No description

static
subWeeks(int $weeks =1)

No description

static
year(int $year =null)

No description

Details

at line50
int|Week isoWeekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

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.

Parameters

int|null $year if null, act as a getter, if not null, set the year and return current instance.
int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
int|null $dayOfYear first day of year included in the week #1

Return Value

int|Week

at line70
int|Week weekYear(int|null$year =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

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).

Parameters

int|null $year if null, act as a getter, if not null, set the year and return current instance.
int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
int|null $dayOfYear first day of year included in the week #1

Return Value

int|Week

at line132
int isoWeeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)

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.

Parameters

int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
int|null $dayOfYear first day of year included in the week #1

Return Value

int

at line150
int weeksInYear(int|null$dayOfWeek =null,int|null$dayOfYear =null)

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).

Parameters

int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday)
int|null $dayOfYear first day of year included in the week #1

Return Value

int

at line180
int|Week week(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

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).

Parameters

int|null $week
int|null $dayOfWeek
int|null $dayOfYear

Return Value

int|Week

at line211
int|Week isoWeek(int|null$week =null,int|null$dayOfWeek =null,int|null$dayOfYear =null)

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.

Parameters

int|null $week
int|null $dayOfWeek
int|null $dayOfYear

Return Value

int|Week

at line37
static addWeeks(int $weeks =1)

Parameters

int $weeks

Return Value

static

at line37
static copy()

Return Value

static

at line37
static dayOfYear(int $dayOfYear)

Parameters

int $dayOfYear

Return Value

static

at line37
string getTranslationMessage(string $key,$translator =null)

Parameters

string $key
$translator

Return Value

string

at line37
static next(int|string $day =null)

Parameters

int|string $day

Return Value

static

at line37
static startOfWeek(int $day =1)

Parameters

int $day

Return Value

static

at line37
static subWeeks(int $weeks =1)

Parameters

int $weeks

Return Value

static

at line37
static year(int $year =null)

Parameters

int $year

Return Value

static