From 6bd2acffd219955162422de77465e13991190cbd Mon Sep 17 00:00:00 2001 From: Jalad Date: Mon, 18 May 2026 23:00:30 -0500 Subject: [PATCH] Updated README and DEVELOPMENT with new info on birthday builtin property. --- DEVELOPMENT.md | 2 ++ README.md | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 9bf0421..80117a0 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -121,6 +121,8 @@ The plugin splits contact-note concerns across two files: - **[`ContactNote.ts`](src/ContactNote.ts)** — the on-disk schema and the `ContactNote` class. Holds the canonical list of built-in fields (their kinds, origins, and default icons) and exposes `getFields()`, `getField(key)`, `getReadKey(field)`, `getIcon(field)`, `applyCustomizations(...)`, and `buildContactNote(firstName, lastName, tag?)`. A single instance lives on the plugin as `plugin.contactNote`. Anything that needs to know *what a contact note looks like on disk*, or *what frontmatter key/icon to use for a built-in field*, should ask this instance. - **[`Contact.ts`](src/Contact.ts)** — the runtime model. `Contact.fromCache(file, frontmatter, frontmatterLinks, contactNote)` walks the field list, reads each value through `contactNote.getReadKey(field)`, and exposes typed fields (`firstName`, `emails`, `socials`, etc.) plus `isValid` and `getFieldLink(readKey)` for fields the user wrote as `[[Target]]` in frontmatter. The card renderer, panel view, and bases view all consume `Contact` instances rather than raw frontmatter. +Frontmatter values that come through YAML as `Date` objects (e.g., bare ISO dates like `1990-04-15`) are coerced to `YYYY-MM-DD` strings by `trimStr` in `Contact.ts`. All scalar fields end up as strings regardless of source type. There is no `Date` kind, and downstream code can assume `string` everywhere. + Adding or removing a built-in frontmatter field starts in `BUILTIN_FIELD_DEFS` (in `ContactNote.ts`). The `Contact.update()` loop, `ContactNote.buildContactNote()`, the bases view's per-entry read loop, and the settings-tab customization grid all iterate `contactNote.getFields()`. ## Frontmatter Customization diff --git a/README.md b/README.md index d43a415..19b76d2 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ All fields are optional except `firstName` and `lastName`. | `title` | text or `[[wikilink]]` | Job title or role. If set to an internal link, the contact card renders it as a clickable link. See [Internal Links](#internal-links). | | `company` | text or `[[wikilink]]` | Company or organization name. If set to an internal link, the contact card renders it as a clickable link. See [Internal Links](#internal-links). | | `department` | text or `[[wikilink]]` | Department, team, or division within the company. If set to an internal link, the contact card renders it as a clickable link. See [Internal Links](#internal-links). | +| `birthday` | text | Birthday. Any format works (e.g. `1990-04-15`, `April 15`, `4/15`). Only displayed on the contact card in reading mode, not in the panel or base views. | | `emails` | text or list | One or more email addresses. | | `phoneNumbers` | text or list | One or more phone numbers. | | `photo` | text | Vault path to a photo file (e.g. `Attachments/jane.jpg`). | @@ -136,6 +137,7 @@ emails: - geordi@notarealemail.com phoneNumbers: - 123-456-7890 +birthday: 2013-05-23 photo: Attachments/Geordi.jpg aliases: - Geordi @@ -181,7 +183,7 @@ Platforms not in this list will still display the handle as plain text without a ![Contact card](assets/screenshots/contact-card.png) -In reading mode, any contact note with a valid `firstName` and `lastName` frontmatter renders a contact card in place of the frontmatter block. The card displays the contact's photo, name, title, company, department, email addresses, phone numbers, and social media profiles. +In reading mode, any contact note with a valid `firstName` and `lastName` frontmatter renders a contact card in place of the frontmatter block. The card displays the contact's photo, name, title, company, department, birthday, email addresses, phone numbers, and social media profiles. ### Display Name Resolution