YearMonthDay

public struct YearMonthDay : Hashable
extension YearMonthDay: Equatable
extension YearMonthDay: BluetoothEncodable

Bluetooth Year Month Day

  • Year

    Year as defined by the Gregorian calendar. Valid between 1582 and 9999

    Declaration

    Swift

    private(set) public var year: UInt16? { get }
  • Month

    Month of the year as defined by the Gregorian calendar

    Declaration

    Swift

    private(set) public var month: Month { get }
  • day

    Day of Month

    Day of the month as defined by the Gregorian calendar

    Declaration

    Swift

    private(set) public var day: UInt8? { get }
  • Create Bluetooth Date Time Type

    Declaration

    Swift

    public init(year: UInt16?, month: Month, day: UInt8?)

    Parameters

    year

    Year

    month

    Month

    day

    Day

  • Creates a YearMonthDay Object from the current date

    Dates are represented in the Gregorian Calendar using current timezone

    Declaration

    Swift

    public static var fromCurrentDate: YearMonthDay { get }
  • Create Bluetooth Year Month Day

    Declaration

    Swift

    public init(_ from: Date, calendar: Calendar = Calendar(identifier: .gregorian))

    Parameters

    from

    Date

    calendar

    Calendar used for Date

  • Decode YearMonthDay

    Throws

    BluetoothDecodeError

    Declaration

    Swift

    static func decode(data: Data) -> YearMonthDay

    Parameters

    data

    YearMonthDay Data

    Return Value

    YearMonthDay Instance

  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

    public static func == (lhs: YearMonthDay, rhs: YearMonthDay) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

  • Encodes Object into Data

    Declaration

    Swift

    public func encode() -> Result<Data, BluetoothEncodeError>

    Return Value

    Encoded Data Result