Overview

Namespaces

  • Apptus
    • ESales
      • Connector
        • Report
        • Time
    • Util
      • Cache
  • PHP

Classes

  • CalendarDate
  • Duration
  • IsoDate
  • IsoDateTime
  • Month
  • OrdinalDate
  • Time
  • TimeInterval
  • TimePoint
  • Unit
  • WeekDate
  • Weekday
  • Overview
  • Namespace
  • Class
  • Tree

Class WeekDate

A week date on the format YYYY-Www-D, as defined by ISO 8601.

ISO 8601 defines week numbers in the following way. The week with the year's first Thursday in it is called week 01. Weeks are numbered from 01 to 52 or 53.

ISO 8601 also defines numbers for day of week. Monday is number 1, Tuesday number 2 and so on up to Sunday which is number 7. Use the Weekday enumeration to convert between day numbers and day names.

Apptus\ESales\Connector\Time\IsoDate
Extended by Apptus\ESales\Connector\Time\WeekDate
Namespace: Apptus\ESales\Connector\Time
Located at Connector/Time/WeekDate.php
Methods summary
public
# __construct( integer $year, integer|null $week, integer|null $dayOfWeek )

Creates a new week date with the specified year, week and day of week.

Creates a new week date with the specified year, week and day of week.

Day of week may be omitted, causing less precision. If day of week is omitted, then week number may also be omitted. However, year is required.

Parameters

$year
year. May not be null.
$week
week number according to ISO 8601. May be null.
$dayOfWeek
weekday according to ISO 8601. May be null.

Throws

InvalidArgumentException
public integer
# year( )

Returns the year. Never returns null.

Returns the year. Never returns null.

Returns

integer
The year.
public integer|null
# week( )

Returns the week. May return null.

Returns the week. May return null.

Returns

integer|null
The week or null if week is not defined.
public integer|null
# dayOfWeek( )

Returns the day of week. May return null.

Returns the day of week. May return null.

Returns

integer|null
The day or null if day is not defined.
public string
# __toString( )

Returns a string with an ISO 8601 representation of this date.

Returns a string with an ISO 8601 representation of this date.

Returns

string
An ISO 8601 representation of this date.
public Apptus\ESales\Connector\Time\TimePoint
# toTimePoint( Apptus\ESales\Connector\Time\Time $t, DateTimeZone $tz )

Returns a point in time represented by this date and a supplied time of day.

Returns a point in time represented by this date and a supplied time of day.

If the date or time lacks precision, or if the time is omitted, then the smallest valid point in time for this specification is used.

Parameters

$t
time of day. May be null.
$tz
timezone.

Returns

Apptus\ESales\Connector\Time\TimePoint
A point in time.
public
# equals( $o )
Methods inherited from Apptus\ESales\Connector\Time\IsoDate
parse(), parseInContext()
Apptus ESales Connector PHP API documentation generated by ApiGen