Countdown to a birthday
Dashy vault/Guides/Countdown to a birthday
Guides/Countdown to a birthday.md

Countdown to a birthday in Obsidian

Properties
blocks
countdown
keys
fieldrepeat: yearly
needs dataview
checked on
Dashy 2.0.0

A birthday is a date you write down once, in the person's note. What you want on your dashboard is a different date: the next time it comes round, how many days are left, and how old they turn. Dashy's countdown reads the first and works out the rest. The same card reads a passport's expiry date from its note.

Countdown cards: two birthdays and a wedding anniversary, each with the days left, the date and the years it marks; below them a passport with days left and a first aid certificate that expired, counting days ago
What you have at the end of step 3. From a demo vault.

1Keep the date in the person's note

One date property with the year of birth, and one property that tells this person's note from the others. Here they are birthday and name.

People/Anna.md
---
name: Anna
birthday: 1991-11-02
---

Likes: climbing, Japanese whisky.
  • birthday: 1991-11-02Year, month, day. A Date property set in Obsidian's Properties panel is the same thing. With a time after it, the time is ignored.
  • name: AnnaAny property works, as long as it picks out one note. Step 2 says why it is needed.

2Count to the next birthday

Make a note for the dates, say Birthdays.md, and paste this block. It is the top row of the picture above.

Birthdays.md
```countdown
items:
  - { label: Anna, field: birthday, repeat: yearly, source: People, where: "name = Anna", icon: 🎂 }
  - { label: Leo, field: birthday, repeat: yearly, source: People, where: "name = Leo", icon: 🎂 }
  - { label: Our wedding, date: 2015-06-20, repeat: yearly, icon: 💍 }
```
  • field: birthdayRead the date from this property instead of writing it on the card. The card's label links to the note it came from.
  • repeat: yearlyCount to the next time the month and day come round, and show how many years that one is: 35 years under Anna's card is the age she turns.
  • where: "name = Anna"Which note to read. A card reads one note: the first in its selection that has the property filled in, notes with a date in their name newest first, then the rest in path order. Without where, all of People is the selection, and every card would show the same person's birthday.
  • date: 2015-06-20A date you would rather write on the card than keep in a note. repeat works the same with it.

On the day itself the card says Today, with the years still under it. The day after, it moves on to next year.

Born on 29 February

In a year without one, the card counts to 28 February. Leo, born 2000-02-29, turns 27 on 28 February 2027 as far as the card is concerned, and 28 on 29 February 2028.

3Expiry dates from a note

The same field reads any date: a passport, a driving licence, a certificate. Keep the date in the document's note.

Documents/Passport.md
---
type: passport
expires: 2031-03-14
---

Number and scans in the attachments folder.

Then, under the birthdays:

Birthdays.md
```countdown
columns: 2
items:
  - { label: Passport, field: expires, where: "type = passport", icon: 🛂 }
  - { label: First aid certificate, field: expires, where: "type = first-aid", icon: ⛑️ }
```
  • No repeatAn expiry date happens once. The card counts down to it, and once it has passed, counts up: 40 days ago. It does not vanish, because a certificate that ran out last month is exactly what you want to see.
  • No sourceWithout it, the card looks through the whole vault. where is enough to find the one note.

Renew the passport, change expires in its note, and the card follows. Nothing on the dashboard needs editing.

The whole note

Both blocks in one piece, ready to paste into an empty note.

Birthdays.md
```countdown
items:
  - { label: Anna, field: birthday, repeat: yearly, source: People, where: "name = Anna", icon: 🎂 }
  - { label: Leo, field: birthday, repeat: yearly, source: People, where: "name = Leo", icon: 🎂 }
  - { label: Our wedding, date: 2015-06-20, repeat: yearly, icon: 💍 }
```

```countdown
columns: 2
items:
  - { label: Passport, field: expires, where: "type = passport", icon: 🛂 }
  - { label: First aid certificate, field: expires, where: "type = first-aid", icon: ⛑️ }
```

Ask your agent

With Dashy's skill installed, an AI agent can write this from a request in plain words: it looks at your property names and folders first, then writes the blocks. Open the note in Reading view and paste any error a block shows back to the agent.

Prompt
In a new note called Birthdays, count down to Anna's and Leo's next birthdays and how old they turn, from the birthday in each person's note. Add our wedding anniversary on 20 June 2015. Below that, the days left until my passport and my first aid certificate expire, from the expiry date in their notes.

What comes back is something like the note above. The agent's YAML may differ from the guide's, with your own property names and labels, but it should do the same, and this guide is the reference to compare it against. More on working with an agent.

The same countdown with Bases or a written date

Two ways people do this today.

Two formulas in a base
formulas:
  thisYear: date(today().year + "-" + birthday.format("MM-DD"))
  nextBirthday: if(formula.thisYear >= today(), formula.thisYear, formula.thisYear + "1y").format("ddd MMM DD")
  • From the forum thread Oct 14 1939 birthday: how to display as occurring on Wed (this year), with the property renamed to birthday.
  • The first formula moves the date into this year, the second moves it to next year once it has passed. That gives the next date. The days left and the age are more formulas on top.
  • The thread itself notes that 29 February needs more logic still.
  • The result is a column in a table view, one row per person.
The date of this year's birthday, typed in
```countdown
items:
  - { label: Anna, date: 2026-11-02 }
```
  • Works, and on 3 November it starts counting up: 1 day ago. Someone has to change the year by hand, every year, for every person.
  • The age is not on the card, and the date lives on the dashboard rather than in Anna's note.
  • With repeat: yearly and the year of birth, date: 1991-11-02, the same card needs no edits.
DashyBasesWritten date
Next daterepeat: yearlyTwo formulasEdit it every year
Days leftOn the cardAnother formulaOn the card
Age they turnOn the cardAnother formulaNo
29 February28 February in other yearsWrite itBy hand
Date kept inThe person's noteThe person's noteThe dashboard

Variations

Every date in one note

No note per person: one property per date, in a single note. Without where, each card finds the one note that has its property.

countdown
```countdown
items:
  - { label: Mum, field: mum_birthday, repeat: yearly, icon: 🎂 }
  - { label: Dad, field: dad_birthday, repeat: yearly, icon: 🎂 }
```

A note to yourself

sub is a line of your own under the date. With repeat, it comes before the years.

countdown
```countdown
items:
  - label: Anna
    field: birthday
    repeat: yearly
    source: People
    where: "name = Anna"
    sub: order the cake a week before
```

Days since

A date in the past without repeat counts up, every day. Handy for "days since I quit".

countdown
```countdown
items:
  - { label: Smoke-free, date: 2025-01-01, icon: 🚭 }
```

People by tag

Your people notes carry #person rather than live in one folder: tag picks them, where still picks the one.

countdown
```countdown
items:
  - { label: Anna, field: birthday, repeat: yearly, tag: person, where: "name = Anna" }
```

If a card shows an error

A card that cannot find its date says so above the cards, and draws a dash. The ones you are likely to see here, and one surprise that comes with no message:

  • No note in the selection has "birthday" filled in. The property name is spelled differently in the note, or source, tag or where match no note that has it.
  • "birthday" in "Anna" is "next week", not a date. The note holds text. Write the date as YYYY-MM-DD, or name your own format next to items:, date_format: DD.MM.YYYY.
  • Both date: and field: are set. A card takes one of them: the date on the card, or a property read from a note.
  • repeat expects yearly. Something else was written, repeat: annual or repeat: true for example.
  • Every card shows the same birthday. The cards have no where, so each reads the same note. Add one per card, as in step 2.