init(style:locale:calendar:fields:)
Shows the date interval with the specified style and the specified date and time fields.
Declaration
init(style: Date.ComponentsFormatStyle.Style, locale: Locale = .autoupdatingCurrent, calendar: Calendar = .autoupdatingCurrent, fields: Set<Date.ComponentsFormatStyle.Field>? = nil)Parameters
- style:
The style for the field names.
- locale:
The locale for formatting the date interval. May affect the language in which the formatted fields are displayed and how the individual fields are connected.
- calendar:
The calendar to interpret date values.
- fields:
The fields to be included in the output string. Chosen automatically based on the interval being formatted if unspecified. Fields with 0 value are dropped.