Contents

CFCalendarGetTimeRangeOfUnit(_:_:_:_:_:)

Returns by reference the start time and duration of a given calendar unit that contains a given absolute time.

Declaration

func CFCalendarGetTimeRangeOfUnit(_ calendar: CFCalendar!, _ unit: CFCalendarUnit, _ at: CFAbsoluteTime, _ startp: UnsafeMutablePointer<CFAbsoluteTime>!, _ tip: UnsafeMutablePointer<CFTimeInterval>!) -> Bool

Parameters

  • calendar:

    The calendar to examine.

  • unit:

    A calendar unit (for valid values, see Cfcalendarunit).

  • at:

    An absolute time.

  • startp:

    Upon return, contains the beginning of the calendar unit specified by unit that contains the time at.

  • tip:

    Upon return, contains the duration of the calendar unit specified by unit that contains the time at.

Return Value

true if the values of startp and tip could be calculated, otherwise false.

Discussion

The function may fail if, for example, you try to get the range of a kCFCalendarUnitWeekday and specify a time (at) that is during a weekend.

See Also

Getting Ranges of Units