Date's container and utilities. More...
Public Member Functions | |
__construct ($date) | |
toStamp () | |
toDate ($delimiter= '-') | |
getYear () | |
getMonth () | |
getDay () | |
getWeek () | |
getWeekDay () | |
spawn ($modification=null) | |
modify ($string) | |
getDayStartStamp () | |
getDayEndStamp () | |
getFirstDayOfWeek ($weekStart=Date::WEEKDAY_MONDAY) | |
getLastDayOfWeek ($weekStart=Date::WEEKDAY_MONDAY) | |
toString () | |
toDialectString (Dialect $dialect) | |
toIsoString () | |
ISO 8601 date string. | |
toTimestamp () | |
Static Public Member Functions | |
static | create ($date) |
static | today ($delimiter= '-') |
static | makeToday () |
static | makeFromWeek ($weekNumber, $year=null) |
static | dayDifference (Date $left, Date $right) |
static | compare (Date $left, Date $right) |
static | getWeekCountInYear ($year) |
Public Attributes | |
const | WEEKDAY_MONDAY = 1 |
const | WEEKDAY_TUESDAY = 2 |
const | WEEKDAY_WEDNESDAY = 3 |
const | WEEKDAY_THURSDAY = 4 |
const | WEEKDAY_FRIDAY = 5 |
const | WEEKDAY_SATURDAY = 6 |
const | WEEKDAY_SUNDAY = 0 |
Protected Member Functions | |
import ($string) | |
stringImport ($string) | |
buildInteger () | |
Static Protected Member Functions | |
static | getFormat () |
Protected Attributes | |
$string = null | |
$int = null | |
$year = null | |
$month = null | |
$day = null |
Date's container and utilities.
Definition at line 21 of file Date.class.php.
Date::__construct | ( | $ | date | ) |
Definition at line 124 of file Date.class.php.
References buildInteger(), getFormat(), and stringImport().
Date::buildInteger | ( | ) | [protected] |
Reimplemented in Timestamp.
Definition at line 330 of file Date.class.php.
Referenced by __construct().
Definition at line 111 of file Date.class.php.
Referenced by RussianTextUtils::getDateAsText(), DateRange::safeSetEnd(), and DateRange::safeSetStart().
static Date::create | ( | $ | date | ) | [static] |
Reimplemented in Timestamp, and CalendarDay.
Definition at line 41 of file Date.class.php.
Referenced by IntervalUnit::countInRange(), DateUtils::makeDatesListByRange(), and toTimestamp().
Definition at line 96 of file Date.class.php.
References getDay(), getMonth(), and getYear().
Referenced by IntervalUnit::countInRange(), and IntervalUnit::truncate().
Date::getDay | ( | ) |
Definition at line 166 of file Date.class.php.
Referenced by dayDifference(), DateUtils::getAgeByBirthDate(), RussianTextUtils::getHumanDay(), and IntervalUnit::truncate().
Date::getDayEndStamp | ( | ) |
Definition at line 231 of file Date.class.php.
Date::getDayStartStamp | ( | ) |
Reimplemented in Timestamp.
Definition at line 220 of file Date.class.php.
Date::getFirstDayOfWeek | ( | $ | weekStart = Date::WEEKDAY_MONDAY |
) |
Definition at line 245 of file Date.class.php.
References getWeekDay(), and spawn().
static Date::getFormat | ( | ) | [static, protected] |
Reimplemented in Timestamp.
Definition at line 289 of file Date.class.php.
Referenced by __construct(), modify(), and stringImport().
Date::getLastDayOfWeek | ( | $ | weekStart = Date::WEEKDAY_MONDAY |
) |
Definition at line 255 of file Date.class.php.
References getWeekDay(), and spawn().
Date::getMonth | ( | ) |
Definition at line 161 of file Date.class.php.
Referenced by CalendarMonthWeekly::__construct(), dayDifference(), DateUtils::getAgeByBirthDate(), RussianTextUtils::getHumanDay(), DateUtils::makeFirstDayOfMonth(), DateUtils::makeLastDayOfMonth(), and IntervalUnit::truncate().
Date::getWeek | ( | ) |
Definition at line 171 of file Date.class.php.
static Date::getWeekCountInYear | ( | $ | year | ) | [static] |
Date::getWeekDay | ( | ) |
Definition at line 176 of file Date.class.php.
Referenced by getFirstDayOfWeek(), and getLastDayOfWeek().
Date::getYear | ( | ) |
Definition at line 156 of file Date.class.php.
Referenced by CalendarMonthWeekly::__construct(), dayDifference(), DateUtils::getAgeByBirthDate(), DateUtils::makeFirstDayOfMonth(), DateUtils::makeLastDayOfMonth(), and IntervalUnit::truncate().
Date::import | ( | $ | string | ) | [protected] |
static Date::makeFromWeek | ( | $ | weekNumber, | |
$ | year = null | |||
) | [static] |
Definition at line 64 of file Date.class.php.
References $year, getWeekCountInYear(), and Assert::isTrue().
static Date::makeToday | ( | ) | [static] |
Reimplemented in Timestamp.
Definition at line 54 of file Date.class.php.
References today().
Referenced by DateUtils::getAgeByBirthDate(), and RussianTextUtils::getHumanDay().
Date::modify | ( | $ | string | ) |
WrongArgumentException |
Definition at line 198 of file Date.class.php.
References $string, and getFormat().
Referenced by DateRange::split().
Date::spawn | ( | $ | modification = null |
) |
Definition at line 184 of file Date.class.php.
Referenced by getFirstDayOfWeek(), getLastDayOfWeek(), and IntervalUnit::truncate().
Date::stringImport | ( | $ | string | ) | [protected] |
Reimplemented in Timestamp.
Definition at line 316 of file Date.class.php.
References $string, and getFormat().
Referenced by __construct().
Date::toDate | ( | $ | delimiter = '-' |
) |
Definition at line 146 of file Date.class.php.
Referenced by CalendarWeek::addDay(), RussianTextUtils::getHumanDay(), CalendarMonthWeekly::setSelected(), Timestamp::toDateTime(), and IntervalUnit::truncate().
static Date::today | ( | $ | delimiter = '-' |
) | [static] |
Definition at line 46 of file Date.class.php.
Referenced by Timestamp::makeToday(), and makeToday().
Date::toDialectString | ( | Dialect $ | dialect | ) |
Implements DialectString.
Definition at line 267 of file Date.class.php.
References toString().
Date::toIsoString | ( | ) |
ISO 8601 date string.
Definition at line 276 of file Date.class.php.
References toString().
Date::toStamp | ( | ) |
Definition at line 141 of file Date.class.php.
Referenced by CalendarMonthWeekly::__construct(), DateUtils::alignToSeconds(), PrimitiveDate::checkRanges(), RussianTextUtils::getDateAsText(), toTimestamp(), and IntervalUnit::truncate().
Date::toString | ( | ) |
Definition at line 262 of file Date.class.php.
Referenced by toDialectString(), and toIsoString().
Date::toTimestamp | ( | ) |
Reimplemented in Timestamp.
Definition at line 284 of file Date.class.php.
References create(), and toStamp().
Referenced by IntervalUnit::truncate().
Date::$day = null [protected] |
Definition at line 36 of file Date.class.php.
Date::$int = null [protected] |
Definition at line 32 of file Date.class.php.
Date::$month = null [protected] |
Definition at line 35 of file Date.class.php.
Date::$string = null [protected] |
Definition at line 31 of file Date.class.php.
Referenced by Timestamp::import(), import(), modify(), Timestamp::stringImport(), and stringImport().
Date::$year = null [protected] |
Definition at line 34 of file Date.class.php.
Referenced by getWeekCountInYear(), and makeFromWeek().
const Date::WEEKDAY_FRIDAY = 5 |
Definition at line 27 of file Date.class.php.
const Date::WEEKDAY_MONDAY = 1 |
Definition at line 23 of file Date.class.php.
const Date::WEEKDAY_SATURDAY = 6 |
Definition at line 28 of file Date.class.php.
const Date::WEEKDAY_SUNDAY = 0 |
Definition at line 29 of file Date.class.php.
const Date::WEEKDAY_THURSDAY = 4 |
Definition at line 26 of file Date.class.php.
const Date::WEEKDAY_TUESDAY = 2 |
Definition at line 24 of file Date.class.php.
const Date::WEEKDAY_WEDNESDAY = 3 |
Definition at line 25 of file Date.class.php.