PHP 트레잇 Cake\Chronos\Traits\ComparisonTrait

상속: use trait Cake\Chronos\Traits\CopyTrait
파일 보기 프로젝트 열기: cakephp/chronos

보호된 프로퍼티들

프로퍼티 타입 설명
$weekendDays array Days of weekend

공개 메소드들

메소드 설명
between ( Cake\Chronos\ChronosInterface $dt1, Cake\Chronos\ChronosInterface $dt2, boolean $equal = true ) : boolean Determines if the instance is between two others
closest ( Cake\Chronos\ChronosInterface $dt1, Cake\Chronos\ChronosInterface $dt2 ) : static Get the closest date from the instance.
eq ( Cake\Chronos\ChronosInterface $dt ) : boolean Determines if the instance is equal to another
farthest ( Cake\Chronos\ChronosInterface $dt1, Cake\Chronos\ChronosInterface $dt2 ) : static Get the farthest date from the instance.
getWeekendDays ( ) : array Get weekend days
gt ( Cake\Chronos\ChronosInterface $dt ) : boolean Determines if the instance is greater (after) than another
gte ( Cake\Chronos\ChronosInterface $dt ) : boolean Determines if the instance is greater (after) than or equal to another
isBirthday ( Cake\Chronos\ChronosInterface $dt = null ) : static Check if its the birthday. Compares the date/month values of the two dates.
isFriday ( ) : boolean Checks if this day is a Friday.
isFuture ( ) : boolean Determines if the instance is in the future, ie. greater (after) than now
isLeapYear ( ) : boolean Determines if the instance is a leap year
isMonday ( ) : boolean Checks if this day is a Monday.
isMutable ( ) : boolean Check if instance of ChronosInterface is mutable.
isPast ( ) : boolean Determines if the instance is in the past, ie. less (before) than now
isSameDay ( Cake\Chronos\ChronosInterface $dt ) : boolean Checks if the passed in date is the same day as the instance current day.
isSaturday ( ) : boolean Checks if this day is a Saturday.
isSunday ( ) : boolean Checks if this day is a Sunday.
isThisMonth ( ) : boolean Returns true if this object represents a date within the current month
isThisWeek ( ) : boolean Returns true if this object represents a date within the current week
isThisYear ( ) : boolean Returns true if this object represents a date within the current year
isThursday ( ) : boolean Checks if this day is a Thursday.
isToday ( ) : boolean Determines if the instance is today
isTomorrow ( ) : boolean Determines if the instance is tomorrow
isTuesday ( ) : boolean Checks if this day is a Tuesday.
isWednesday ( ) : boolean Checks if this day is a Wednesday.
isWeekday ( ) : boolean Determines if the instance is a weekday
isWeekend ( ) : boolean Determines if the instance is a weekend day
isWithinNext ( string | integer $timeInterval ) : boolean Returns true this instance will happen within the specified interval
isYesterday ( ) : boolean Determines if the instance is yesterday
lt ( Cake\Chronos\ChronosInterface $dt ) : boolean Determines if the instance is less (before) than another
lte ( Cake\Chronos\ChronosInterface $dt ) : boolean Determines if the instance is less (before) or equal to another
max ( Cake\Chronos\ChronosInterface $dt = null ) : static Get the maximum instance between a given instance (default now) and the current instance.
min ( Cake\Chronos\ChronosInterface $dt = null ) : static Get the minimum instance between a given instance (default now) and the current instance.
ne ( Cake\Chronos\ChronosInterface $dt ) : boolean Determines if the instance is not equal to another
setWeekendDays ( array $days ) : void Set weekend days
wasWithinLast ( string | integer $timeInterval ) : boolean Returns true this instance happened within the specified interval

메소드 상세

between() 공개 메소드

Determines if the instance is between two others
public between ( Cake\Chronos\ChronosInterface $dt1, Cake\Chronos\ChronosInterface $dt2, boolean $equal = true ) : boolean
$dt1 Cake\Chronos\ChronosInterface The instance to compare with.
$dt2 Cake\Chronos\ChronosInterface The instance to compare with.
$equal boolean Indicates if a > and < comparison should be used or <= or >=
리턴 boolean

closest() 공개 메소드

Get the closest date from the instance.
public closest ( Cake\Chronos\ChronosInterface $dt1, Cake\Chronos\ChronosInterface $dt2 ) : static
$dt1 Cake\Chronos\ChronosInterface The instance to compare with.
$dt2 Cake\Chronos\ChronosInterface The instance to compare with.
리턴 static

eq() 공개 메소드

Determines if the instance is equal to another
public eq ( Cake\Chronos\ChronosInterface $dt ) : boolean
$dt Cake\Chronos\ChronosInterface The instance to compare with.
리턴 boolean

farthest() 공개 메소드

Get the farthest date from the instance.
public farthest ( Cake\Chronos\ChronosInterface $dt1, Cake\Chronos\ChronosInterface $dt2 ) : static
$dt1 Cake\Chronos\ChronosInterface The instance to compare with.
$dt2 Cake\Chronos\ChronosInterface The instance to compare with.
리턴 static

getWeekendDays() 공개 정적인 메소드

Get weekend days
public static getWeekendDays ( ) : array
리턴 array

gt() 공개 메소드

Determines if the instance is greater (after) than another
public gt ( Cake\Chronos\ChronosInterface $dt ) : boolean
$dt Cake\Chronos\ChronosInterface The instance to compare with.
리턴 boolean

gte() 공개 메소드

Determines if the instance is greater (after) than or equal to another
public gte ( Cake\Chronos\ChronosInterface $dt ) : boolean
$dt Cake\Chronos\ChronosInterface The instance to compare with.
리턴 boolean

isBirthday() 공개 메소드

Check if its the birthday. Compares the date/month values of the two dates.
public isBirthday ( Cake\Chronos\ChronosInterface $dt = null ) : static
$dt Cake\Chronos\ChronosInterface The instance to compare with or null to use current day.
리턴 static

isFriday() 공개 메소드

Checks if this day is a Friday.
public isFriday ( ) : boolean
리턴 boolean

isFuture() 공개 메소드

Determines if the instance is in the future, ie. greater (after) than now
public isFuture ( ) : boolean
리턴 boolean

isLeapYear() 공개 메소드

Determines if the instance is a leap year
public isLeapYear ( ) : boolean
리턴 boolean

isMonday() 공개 메소드

Checks if this day is a Monday.
public isMonday ( ) : boolean
리턴 boolean

isMutable() 공개 메소드

Check if instance of ChronosInterface is mutable.
public isMutable ( ) : boolean
리턴 boolean

isPast() 공개 메소드

Determines if the instance is in the past, ie. less (before) than now
public isPast ( ) : boolean
리턴 boolean

isSameDay() 공개 메소드

Checks if the passed in date is the same day as the instance current day.
public isSameDay ( Cake\Chronos\ChronosInterface $dt ) : boolean
$dt Cake\Chronos\ChronosInterface The instance to check against.
리턴 boolean

isSaturday() 공개 메소드

Checks if this day is a Saturday.
public isSaturday ( ) : boolean
리턴 boolean

isSunday() 공개 메소드

Checks if this day is a Sunday.
public isSunday ( ) : boolean
리턴 boolean

isThisMonth() 공개 메소드

Returns true if this object represents a date within the current month
public isThisMonth ( ) : boolean
리턴 boolean

isThisWeek() 공개 메소드

Returns true if this object represents a date within the current week
public isThisWeek ( ) : boolean
리턴 boolean

isThisYear() 공개 메소드

Returns true if this object represents a date within the current year
public isThisYear ( ) : boolean
리턴 boolean

isThursday() 공개 메소드

Checks if this day is a Thursday.
public isThursday ( ) : boolean
리턴 boolean

isToday() 공개 메소드

Determines if the instance is today
public isToday ( ) : boolean
리턴 boolean

isTomorrow() 공개 메소드

Determines if the instance is tomorrow
public isTomorrow ( ) : boolean
리턴 boolean

isTuesday() 공개 메소드

Checks if this day is a Tuesday.
public isTuesday ( ) : boolean
리턴 boolean

isWednesday() 공개 메소드

Checks if this day is a Wednesday.
public isWednesday ( ) : boolean
리턴 boolean

isWeekday() 공개 메소드

Determines if the instance is a weekday
public isWeekday ( ) : boolean
리턴 boolean

isWeekend() 공개 메소드

Determines if the instance is a weekend day
public isWeekend ( ) : boolean
리턴 boolean

isWithinNext() 공개 메소드

Returns true this instance will happen within the specified interval
public isWithinNext ( string | integer $timeInterval ) : boolean
$timeInterval string | integer the numeric value with space then time type. Example of valid types: 6 hours, 2 days, 1 minute.
리턴 boolean

isYesterday() 공개 메소드

Determines if the instance is yesterday
public isYesterday ( ) : boolean
리턴 boolean

lt() 공개 메소드

Determines if the instance is less (before) than another
public lt ( Cake\Chronos\ChronosInterface $dt ) : boolean
$dt Cake\Chronos\ChronosInterface The instance to compare with.
리턴 boolean

lte() 공개 메소드

Determines if the instance is less (before) or equal to another
public lte ( Cake\Chronos\ChronosInterface $dt ) : boolean
$dt Cake\Chronos\ChronosInterface The instance to compare with.
리턴 boolean

max() 공개 메소드

Get the maximum instance between a given instance (default now) and the current instance.
public max ( Cake\Chronos\ChronosInterface $dt = null ) : static
$dt Cake\Chronos\ChronosInterface The instance to compare with.
리턴 static

min() 공개 메소드

Get the minimum instance between a given instance (default now) and the current instance.
public min ( Cake\Chronos\ChronosInterface $dt = null ) : static
$dt Cake\Chronos\ChronosInterface The instance to compare with.
리턴 static

ne() 공개 메소드

Determines if the instance is not equal to another
public ne ( Cake\Chronos\ChronosInterface $dt ) : boolean
$dt Cake\Chronos\ChronosInterface The instance to compare with.
리턴 boolean

setWeekendDays() 공개 정적인 메소드

Set weekend days
public static setWeekendDays ( array $days ) : void
$days array Which days are 'weekends'.
리턴 void

wasWithinLast() 공개 메소드

Returns true this instance happened within the specified interval
public wasWithinLast ( string | integer $timeInterval ) : boolean
$timeInterval string | integer the numeric value with space then time type. Example of valid types: 6 hours, 2 days, 1 minute.
리턴 boolean

프로퍼티 상세

$weekendDays 보호되어 있는 정적으로 프로퍼티

Days of weekend
protected static array $weekendDays
리턴 array