CPCDateIntervalInitializable
public protocol CPCDateIntervalInitializable : CPCDateInterval
Common protocol for types that can be initialized with a date interval.
-
init(_:)
Default implementationCreates a new, empty date interval.
Default Implementation
Undocumented
Undocumented
Declaration
Swift
init(_ date: Date)
Parameters
date
This date is used as
start
andend
of resulting date interval simultaneously. -
Creates a new date interval that is equivalent to another one.
Declaration
Swift
init<R>(_ other: R) where R : RangeExpression, R.Bound == Date
Parameters
other
Date interval to be copied.
-
Creates a new date interval that is equivalent to another one.
Declaration
Swift
init<R>(_ other: R) where R : CPCDateInterval
Parameters
other
Date interval to be copied.
-
clamped(to:)
Default implementationReturns a copy of this date interval clamped to the given limiting date interval.
Default Implementation
Undocumented
Undocumented
Declaration
Swift
func clamped<R>(to other: R) -> Self where R : RangeExpression, R.Bound == Date
Parameters
other
The interval to clamp the bounds of this date interval.
Return Value
A new date interval clamped to the bounds of
other
. -
Returns a copy of this date interval clamped to the given limiting date interval.
Declaration
Swift
func clamped<R>(to other: R) -> Self where R : CPCDateInterval
Parameters
other
The interval to clamp the bounds of this date interval.
Return Value
A new date interval clamped to the bounds of
other
.