weekOfMonth
TypeScriptstatic get weekOfMonth(): Date_FormatStyle_Symbol_WeekSwift declarationstatic var weekOfMonth: Date.FormatStyle.Symbol.Week { get }One-digit numeric week of month, starting from 1. For example, `1`.
struct · iOS 15.0+ · SDK 27.1
struct WeekA type that specifies the format for the week in a date format style. The type ``Date/FormatStyle/Symbol/Week`` includes static factory variables that create custom ``Date/FormatStyle/Symbol/Week`` objects: |Factory variable|Description| |---|---| | ``defaultDigits`` | The minimum number of digits that represents the full numeric week. For example, `1`, `18`. | | ``twoDigits`` | Two-digit numeric week, zero-padded if necessary. For example, `01`, `18`. | | ``weekOfMonth`` | The numeric week of the month. For example, `1`, `4`. | To customize the week format in a string representation of a `Date`, use ``Date/FormatStyle/week(_:)``. The following example shows a variety of ``Date/FormatStyle/Symbol/Week`` format styles applied to a date. ```swift let meetingDate = Date() // May 3, 2021 at 3:00 PM meetingDate.formatted(Date.FormatStyle().week(.defaultDigits)) // 19 meetingDate.formatted(Date.FormatStyle().week(.twoDigits)) // 19 meetingDate.formatted(Date.FormatStyle().week(.weekOfMonth)) // 2 meetingDate.formatted(Date.FormatStyle().week()) // 19 ``` An incomplete week at the start of a month is week of the month `1`. If no format is specified as a parameter, the ``defaultDigits`` static variable is the default format. For more information about formatting dates, see the ``Date/FormatStyle``.
static get weekOfMonth(): Date_FormatStyle_Symbol_WeekSwift declarationstatic var weekOfMonth: Date.FormatStyle.Symbol.Week { get }One-digit numeric week of month, starting from 1. For example, `1`.
static get defaultDigits(): Date_FormatStyle_Symbol_WeekSwift declarationstatic var defaultDigits: Date.FormatStyle.Symbol.Week { get }Numeric week of year. For example, `8`, `27`.
static get omitted(): Date_FormatStyle_Symbol_WeekSwift declarationstatic let omitted: Date.FormatStyle.Symbol.WeekThe option for not including the symbol in the formatted output.
static get twoDigits(): Date_FormatStyle_Symbol_WeekSwift declarationstatic var twoDigits: Date.FormatStyle.Symbol.Week { get }Two-digit numeric week of year, zero padded as necessary. For example, `08`, `27`.
No declarations were skipped in this snapshot.