CPCDateInterval
public protocol CPCDateInterval : RangeExpression where Self.Bound == Date
Common protocol for types representing an arbitrary range of dates.
-
Earliest date that is included in date interval.
Declaration
Swift
var start: Date { get } -
Earliest date that is not included in date interval and is later than
start(analogous toRange <Date>.upperBound).Declaration
Swift
var end: Date { get } -
durationDefault implementationDuration of date interval. Default implementation returns
self.end.timeIntervalSince (self.start).Default Implementation
Declaration
Swift
var duration: TimeInterval { get } -
contains(_:)Default implementationReturns a Boolean value indicating whether this date interval is fully contained or is equal to the given range.
Default Implementation
Undocumented
Undocumented
Undocumented
Declaration
Swift
func contains<R>(_ dateInterval: R) -> Bool where R : RangeExpression, R.Bound == DateParameters
dateIntervalAn interval to check.
Return Value
trueifdateIntervalis contained in this one; otherwise,false. -
Returns a Boolean value indicating whether this date interval is fully contained or is equal to the given range.
Declaration
Swift
func contains<R>(_ dateInterval: R) -> Bool where R : CPCDateIntervalParameters
dateIntervalAn interval to check.
Return Value
trueifdateIntervalis contained in this one; otherwise,false.
-
relative(to:)Extension methodDeclaration
Swift
public func relative<C>(to collection: C) -> Range<Date> where C : Collection, C.Index == Date
View on GitHub
Install in Dash
CPCDateInterval Protocol Reference