DateInterval
public extension DateInterval
-
Returns true if self fully overlaps with interval
Declaration
Swift
func fullyOverlaps(with interval: DateInterval) -> BoolParameters
intervalinterval to compare with
-
Returns true if self partially overlaps with interval
Declaration
Swift
func partiallyOverlaps(with interval: DateInterval) -> BoolParameters
intervalinterval to compare with
-
Return the duration in hours, truncated to the nearest lower integer
Declaration
Swift
var durationHours: Int { get } -
Return seconds from hours
Declaration
Swift
internal static func secondsFromHours(_ hours: Int) -> TimeIntervalParameters
hourswhole hours to convert to seconds
Return Value
seconds
-
Intitialize from startDate (truncating to the whole hour) and duration
Declaration
Swift
init?(startDate: Date, durationHours: Int = 1)Parameters
startDatestart
durationHourshours
-
Return a two-year interval around the data
Declaration
Swift
static func twoYearsAround(date: Date) -> DateIntervalParameters
datecenter of the interval
Return Value
DateInterval
-
Return true if the interval is fully in the future, false otherwise
Declaration
Swift
var isInTheFuture: Bool { get } -
Declaration
Swift
var brief: String { get }