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 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
yearYear
monthMonth
dayDay
-
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
fromDate
calendarCalendar used for Date
-
Decode YearMonthDay
Throws
BluetoothDecodeErrorDeclaration
Swift
static func decode(data: Data) -> YearMonthDayParameters
dataYearMonthDay Data
Return Value
YearMonthDay Instance
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
aandb,a == bimplies thata != bisfalse.Declaration
Swift
public static func == (lhs: YearMonthDay, rhs: YearMonthDay) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
-
Encodes Object into Data
Declaration
Swift
public func encode() -> Result<Data, BluetoothEncodeError>Return Value
Encoded Data Result