abbreviated
TypeScriptstatic get abbreviated(): Date_FormatStyle_Symbol_QuarterSwift declarationstatic var abbreviated: Date.FormatStyle.Symbol.Quarter { get }Abbreviated quarter. For example `Q2`.
struct · iOS 15.0+ · SDK 27.1
struct QuarterA type that specifies the format for the quarter in a date format style. The type ``Date/FormatStyle/Symbol/Quarter`` includes static factory variables that create custom ``Date/FormatStyle/Symbol/Quarter`` objects: |Factory variable|Description| |---|---| | ``abbreviated`` | Abbreviated quarter name. For example, `Q2`. | | ``narrow`` | Minimum number of digits that represents the numeric quarter. For example, `2`. | | ``oneDigit`` | One-digit numeric quarter. For example, `1`, `4`. | | ``twoDigits`` | Two-digit numeric quarter, zero-padded if necessary. For example, `01`, `04`. | | ``wide`` | Wide quarter name. For example, `2nd quarter`. | To customize the month format in a string representation of a `Date`, use ``Date/FormatStyle/quarter(_:)``. The following example shows a variety of ``Date/FormatStyle/Symbol/Quarter`` format styles applied to a date. ```swift let meetingDate = Date() // Oct 7, 2020 at 3:00 PM meetingDate.formatted(Date.FormatStyle().quarter(.abbreviated)) // Q4 meetingDate.formatted(Date.FormatStyle().quarter(.narrow)) // 4th quarter meetingDate.formatted(Date.FormatStyle().quarter(.oneDigit)) // 4 meetingDate.formatted(Date.FormatStyle().quarter(.twoDigits)) // 04 meetingDate.formatted(Date.FormatStyle().quarter(.wide)) // 4th quarter meetingDate.formatted(Date.FormatStyle().quarter()) // Q4 ``` If no format is specified as a parameter, the ``abbreviated`` static variable is the default format. For more information about formatting dates, see the ``Date/FormatStyle``.
static get abbreviated(): Date_FormatStyle_Symbol_QuarterSwift declarationstatic var abbreviated: Date.FormatStyle.Symbol.Quarter { get }Abbreviated quarter. For example `Q2`.
static get wide(): Date_FormatStyle_Symbol_QuarterSwift declarationstatic var wide: Date.FormatStyle.Symbol.Quarter { get }The quarter spelled out in full, for example `2nd quarter`.
static get narrow(): Date_FormatStyle_Symbol_QuarterSwift declarationstatic var narrow: Date.FormatStyle.Symbol.Quarter { get }Narrow quarter. For example `2`.
static get omitted(): Date_FormatStyle_Symbol_QuarterSwift declarationstatic let omitted: Date.FormatStyle.Symbol.QuarterThe option for not including the symbol in the formatted output.
static get oneDigit(): Date_FormatStyle_Symbol_QuarterSwift declarationstatic var oneDigit: Date.FormatStyle.Symbol.Quarter { get }Numeric: one digit quarter. For example `2`.
static get twoDigits(): Date_FormatStyle_Symbol_QuarterSwift declarationstatic var twoDigits: Date.FormatStyle.Symbol.Quarter { get }Numeric: two digits with zero padding. For example `02`.
No declarations were skipped in this snapshot.