Instance Property

calendar

The default calendar to use when formatting date components.

Declaration

@property(copy) NSCalendar *calendar;

Discussion

The formatter uses the calendar in this property to format values that do not have an inherent calendar of their own. For example, the formatter uses this calendar when formatting an NSTimeInterval value.

The default value of this property is the calendar returned by the autoupdatingCurrentCalendar method of NSCalendar. Setting this property to nil causes the formatter to use the Gregorian calendar with the en_US_POSIX locale.

See Also

Configuring the Formatter Options

allowedUnits

The bitmask of calendrical units such as day and month to include in the output string.

allowsFractionalUnits

A Boolean indicating whether non-integer units may be used for values.

collapsesLargestUnit

A Boolean value indicating whether to collapse the largest unit into smaller units when a certain threshold is met.

includesApproximationPhrase

A Boolean value indicating whether the resulting phrase reflects an inexact time value.

includesTimeRemainingPhrase

A Boolean value indicating whether output strings reflect the amount of time remaining.

maximumUnitCount

The maximum number of time units to include in the output string.

unitsStyle

The formatting style for unit names.

zeroFormattingBehavior

The formatting style for units whose value is 0.