Calendar
A definition of the relationships between calendar units and absolute points in time, providing features for calculation and comparison of dates.
Declaration
struct CalendarOverview
Calendar encapsulates information about systems of reckoning time in which the beginning, length, and divisions of a year are defined. It provides information about the calendar and support for calendrical computations such as determining the range of a given calendrical unit and adding units to a given absolute time.
Topics
Creating a Calendar
Getting the User’s Calendar
Extracting Components
date(_:matchesComponents:)component(_:from:)dateComponents(_:from:)dateComponents(_:from:to:)dateComponents(_:from:to:)dateComponents(in:from:)Calendar.Component
Getting Calendar Information
identifierlocalefirstWeekdayminimumDaysInFirstWeektimeZonemaximumRange(of:)minimumRange(of:)ordinality(of:in:for:)range(of:in:for:)
Scanning Dates
startOfDay(for:)enumerateDates(startingAfter:matching:matchingPolicy:repeatedTimePolicy:direction:using:)nextDate(after:matching:matchingPolicy:repeatedTimePolicy:direction:)Calendar.MatchingPolicyCalendar.RepeatedTimePolicy
Calculating Dates from Components
date(from:)date(byAdding:to:wrappingComponents:)date(byAdding:value:to:wrappingComponents:)date(bySetting:value:of:)date(bySettingHour:minute:second:of:matchingPolicy:repeatedTimePolicy:direction:)
Calculating Intervals
dateInterval(of:for:)dateInterval(of:start:interval:for:)dateIntervalOfWeekend(containing:)dateIntervalOfWeekend(containing:start:interval:)nextWeekend(startingAfter:direction:)nextWeekend(startingAfter:start:interval:direction:)Calendar.SearchDirection
Comparing Dates
compare(_:to:toGranularity:)isDate(_:equalTo:toGranularity:)isDate(_:inSameDayAs:)isDateInToday(_:)isDateInTomorrow(_:)isDateInYesterday(_:)isDateInWeekend(_:)
Getting AM and PM symbols
Getting Weekday Symbols
weekdaySymbolsshortWeekdaySymbolsveryShortWeekdaySymbolsstandaloneWeekdaySymbolsshortStandaloneWeekdaySymbolsveryShortStandaloneWeekdaySymbols
Getting Month Symbols
monthSymbolsshortMonthSymbolsveryShortMonthSymbolsstandaloneMonthSymbolsshortStandaloneMonthSymbolsveryShortStandaloneMonthSymbols