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
-
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 givendateComponents
.Throws
whendateComponents
have at least anil
month
,day
, or if they are not valid in the Gregorian calendar.Declaration
Swift
init(dateComponents: DateComponents) throws
-
The
DateComponents
representation of this month and day.Declaration
Swift
var dateComponents: DateComponents { get }
-
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