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?
  • day

    The day of the month; must be valid for the month (not enforced in code!).

    Declaration

    Swift

    public var day: UInt8?
  • id

    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

    year

    The year of the date

    month

    The month of the year

    day

    The 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

    string

    The string to parse the date from

  • Declaration

    Swift

    public init(json: JSONType, owner: FHIRAbstractBase?, context: inout FHIRInstantiationContext)

    Parameters

    json

    The value in its associated JSONType

    owner

    Optional, the owning element

    context

    An in-out parameter for the instantiation context

  • Declaration

    Swift

    public func asJSON(errors: inout [FHIRValidationError]) -> JSONType

    Parameters

    errors

    Errors 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) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

  • Declaration

    Swift

    public static func <(lhs: FHIRDate, rhs: FHIRDate) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.