Creates and returns a text provider with the specified date and style information.
SDK
- watchOS 2.0+
Framework
- Clock
Kit
Declaration
convenience init(date: Date, style: CLKRelative Date Style, units calendarUnits: NSCalendar.Unit)
Parameters
date
The date to use for calculations. This parameter must not be
nil
.style
The style to use when formatting the relative date value. For a list of possible values, see
CLKRelative
.Date Style calendarUnits
The units to include in the resulting date string. For a list of supported calendar units, see Date Format Options.
Return Value
A text provider initialized with the specified date and style information.
Discussion
The text provider created by this method uses the default time zone information for the current user. Date values are formatted according to the user’s current locale information.