Skip to content

Instance Method

dateIntervalOfWeekend(containing:)

iOS 10.0+ iPadOS 10.0+ Mac Catalyst 10.0+ macOS 10.12+ tvOS 10.0+ watchOS 3.0+
Returns a DateInterval of the weekend contained by the given date, or nil if the date is not in a weekend.
func dateIntervalOfWeekend(containing date: Date) -> DateInterval?

Parameters

date

The date contained in the weekend.

Return Value

A DateInterval, or nil if the date is not in a weekend.