Date

The ContactDate model represents important dates associated with a contact in the ContactsManager SDK.

Properties

  • id: String - Unique identifier for the date entry
  • contactId: String - Identifier of the parent contact
  • label: String - Description or category of the date (e.g. anniversary, graduation, birthday)
  • date: Date - The actual date value
  • isPrimary: Bool - Indicates if this is the primary date of its type for the contact
  • contact: Contact? - Reference to the parent contact that owns this date

Usage Example

// Create a date entry
let anniversary = ContactDate(
    contactId: "contact-123",
    label: "anniversary",
    date: Date(timeIntervalSince1970: 1435708800), // June 1, 2015
    isPrimary: true
)

// Add to a contact
contact.dates.append(anniversary)

// Access from a contact
if let firstDate = contact.dates.first {
    print("Important date: \(firstDate.displayString())")
}