---
title: "date(from:to:)"
framework: relevancekit
role: symbol
role_heading: Type Method
path: "relevancekit/relevantcontext/date(from:to:)"
---

# date(from:to:)

Tells the system a widget is relevant between two dates.

## Declaration

```swift
static func date(from: Date, to: Date) -> RelevantContext
```

## Parameters

- `from`: The moment the widget becomes most relevant to a person.
- `to`: The moment the widget is no longer relevant to a person.

## Return Value

Return Value A contextual clue that the system uses to determine the relevance of a widget in the Smart Stack on Apple Watch.

## Discussion

Discussion note: Smart Stacks are available in iOS, iPadOS, and watchOS. However, functionality provided by RelevanceKit API is only available in watchOS. Calling its API on other platforms doesn’t have any effect. For more information, refer to Increasing the visibility of widgets in Smart Stacks.

## See Also

### Time clues

- [date(_:)](relevancekit/relevantcontext/date(_:).md)
- [date(_:kind:)](relevancekit/relevantcontext/date(_:kind:).md)
- [date(interval:kind:)](relevancekit/relevantcontext/date(interval:kind:).md)
- [date(range:kind:)](relevancekit/relevantcontext/date(range:kind:).md)
- [RelevantContext.DateKind](relevancekit/relevantcontext/datekind.md)
