FHIRDate
public struct FHIRDate: DateAndTime
A date for use in human communication. Named FHIRDate to avoid the numerous collisions with Foundation.Date.
Month and day are optional and there are no timezones.
-
The year.
Declaration
Swift
public var year: Int -
The month of the year, maximum of 12.
Declaration
Swift
public var month: UInt8? -
The day of the month; must be valid for the month (not enforced in code!).
Declaration
Swift
public var day: UInt8? -
An optional id of the element.
Declaration
Swift
public var id: String? -
The parent/owner of the receiver, if any. Used to dereference resources.
Declaration
Swift
public weak var _owner: FHIRAbstractBase? -
Optional extensions of the element.
Declaration
Swift
public var extension_fhir: [Extension]? -
Today’s date.
Declaration
Swift
public static var today: FHIRDate -
Designated initializer. Everything but the year is optional, invalid months or days will be ignored (however it is NOT checked whether the given month indeed contains the given day).
Declaration
Swift
public init(year: Int, month: UInt8?, day: UInt8?)Parameters
yearThe year of the date
monthThe month of the year
dayThe day of the month – your responsibility to ensure the month has the desired number of days; ignored if no month is given
-
Initializes a date with our
DateAndTimeParser.Will fail unless the string contains at least a valid year.
Declaration
Swift
public init?(string: String)Parameters
stringThe string to parse the date from
-
Declaration
Swift
public init(json: JSONType, owner: FHIRAbstractBase?, context: inout FHIRInstantiationContext)Parameters
jsonThe value in its associated
JSONTypeownerOptional, the owning element
contextAn in-out parameter for the instantiation context
-
Declaration
Swift
public func asJSON(errors: inout [FHIRValidationError]) -> JSONTypeParameters
errorsErrors encountered during serialization
Return Value
The FHIRJSON reperesentation of the receiver
-
Undocumented
Declaration
Swift
public struct FHIRDate: DateAndTime -
Declaration
Swift
public var description: String
-
Declaration
Swift
public static func ==(lhs: FHIRDate, rhs: FHIRDate) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
-
Declaration
Swift
public static func <(lhs: FHIRDate, rhs: FHIRDate) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
View on GitHub
Install in Dash
FHIRDate Struct Reference