MonthDay

struct MonthDay
extension MonthDay : AutomationValue, Copyable, Decodable, Encodable, Equatable, Escapable, Hashable, Sendable, Sendable, StructDataRepresentable

Represents month and day.

This struct doesn’t include any time zone related information.

  • The month component.

    Declaration

    Swift

    let month: LocalDate.Month
  • day

    The day component.

    Declaration

    Swift

    let day: Int32
  • Initializes the MonthDay with the month and day.

    Declaration

    Swift

    init(month: LocalDate.Month, day: Int32)
  • Initializes MonthDay with the trait decoder.

    Declaration

    Swift

    init(decoder: TraitDecoder) throws
  • Encodes MonthDay to the trait encoder.

    Declaration

    Swift

    func encode(with encoder: TraitEncoder) throws
  • Initializes a MonthDay by converting the given dateComponents.

    Throws

    when dateComponents have at least a nil month, day, or if they are not valid in the Gregorian calendar.

    Declaration

    Swift

    init(dateComponents: DateComponents) throws

    Parameters

    dateComponents

    The date components with the month, day to use.

  • The DateComponents representation of this month and day.

    Declaration

    Swift

    var dateComponents: DateComponents { get }
  • Undocumented

    Declaration

    Swift

    enum StructFields
    extension MonthDay.StructFields : Equatable, Field, Hashable, RawRepresentable, Sendable
  • Returns the field corresponding to the given field ID.

    Declaration

    Swift

    static func structField(id: UInt32) -> (any Field)?
  • Creates a new instance by decoding from the given decoder.

    This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

    Declaration

    Swift

    init(from decoder: any Decoder) throws