Contents

dateComponents(for:)

Date components that uniquely identify the day represented by the summary object.

Declaration

func dateComponents(for calendar: Calendar) -> DateComponents

Parameters

  • calendar:

    The calendar used to calculate the date components.

Return Value

Date components that uniquely specify a day. For example, for the Gregorian calendar, the date components consist of only the era, year, month, and day.

Discussion

Each activity summary covers a single day. The day always begins and ends at midnight; however, the day may be longer or shorter than 24 hours (for example, if the user traveled across time zones).

See Also

Accessing the summary’s data