---
title: "dateIntervalOfWeekend(containing:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/calendar/dateintervalofweekend(containing:)"
---

# dateIntervalOfWeekend(containing:)

Returns a DateInterval of the weekend contained by the given date, or nil if the date is not in a weekend.

## Declaration

```swift
func dateIntervalOfWeekend(containing date: Date) -> DateInterval?
```

## Parameters

- `date`: The date contained in the weekend.

## Return Value

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

## See Also

### Calculating Intervals

- [dateInterval(of:for:)](foundation/calendar/dateinterval(of:for:).md)
- [dateInterval(of:start:interval:for:)](foundation/calendar/dateinterval(of:start:interval:for:).md)
- [dateIntervalOfWeekend(containing:start:interval:)](foundation/calendar/dateintervalofweekend(containing:start:interval:).md)
- [nextWeekend(startingAfter:direction:)](foundation/calendar/nextweekend(startingafter:direction:).md)
- [nextWeekend(startingAfter:start:interval:direction:)](foundation/calendar/nextweekend(startingafter:start:interval:direction:).md)
- [Calendar.SearchDirection](foundation/calendar/searchdirection.md)
