abbreviated
TypeScriptstatic get abbreviated(): Date_FormatStyle_Symbol_EraSwift declarationstatic var abbreviated: Date.FormatStyle.Symbol.Era { get }Abbreviated Era name. For example, "AD", "Reiwa", "令和".
struct · iOS 15.0+ · SDK 27.1
struct EraA type that specifies a format for the era in a date format style. The type ``Date/FormatStyle/Symbol/Era`` includes static factory variables that create custom ``Date/FormatStyle/Symbol/Era`` objects. |Factory variable|Description| |---|---| | ``abbreviated`` | An abbreviated representation of an era. For example, `AD`, `BC`. | | ``narrow`` | A narrow era representation. For example, `A`, `B`. | | ``wide`` | A full representation of an era. For example, `Anno Domini`, `Before Christ`. | To customize the era format in a string representation of a `Date`, use ``Date/FormatStyle/era(_:)``. The following example shows a variety of ``Date/FormatStyle/Symbol/Era`` format styles applied to a date. ```swift let meetingDate = Date() // Feb 9, 2021 at 3:00 PM meetingDate.formatted(Date.FormatStyle().era(.abbreviated)) // AD meetingDate.formatted(Date.FormatStyle().era(.narrow)) // A meetingDate.formatted(Date.FormatStyle().era(.wide)) // Anno Domini meetingDate.formatted(Date.FormatStyle().era()) // AD ``` 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_EraSwift declarationstatic var abbreviated: Date.FormatStyle.Symbol.Era { get }Abbreviated Era name. For example, "AD", "Reiwa", "令和".
static get wide(): Date_FormatStyle_Symbol_EraSwift declarationstatic var wide: Date.FormatStyle.Symbol.Era { get }Wide era name. For example, "Anno Domini", "Reiwa", "令和".
static get narrow(): Date_FormatStyle_Symbol_EraSwift declarationstatic var narrow: Date.FormatStyle.Symbol.Era { get }Narrow era name. For example, For example, "A", "R", "R".
static get omitted(): Date_FormatStyle_Symbol_EraSwift declarationstatic let omitted: Date.FormatStyle.Symbol.EraThe option for not including the symbol in the formatted output.
No declarations were skipped in this snapshot.