# Day Countdown in a Table

**URL:** https://community.silverbullet.md/t/day-countdown-in-a-table/1682
**Category:** v1: Troubleshooting (legacy)
**Created:** [January 21, 2025, 8:03pm UTC](https://community.silverbullet.md/t/day-countdown-in-a-table/1682 "2025-01-21T20:03:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![docfips](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/d/f14d63/32.png) [@docfips](https://community.silverbullet.md/u/docfips)
#### Post date: [January 21, 2025, 8:03pm UTC](https://community.silverbullet.md/t/day-countdown-in-a-table/1682/1 "2025-01-21T20:03:52Z")

</div>

So, here is my ‘idea’

I’d like to make a table where I can events or birthdays in one column, and in the other have the days but count down each day.

| Event | Days until |
| --- | --- |
| Person Birthday | Days left until |
| Upcoming Event | Days left until |
| Another person birthday | Days left until |

```space-script
| Event | Days until |
| ---- | --- |
| Person Birthday | Days left until |
| Upcoming Event | Days left until |
| Another person birthday | Days left until |

```

I’ve been dabbling with this:

```space-script
silverbullet.registerFunction("daysTillDate",(date) => {
  const parsedDate = Temporal.PlainDate.from(date)
  const now = Temporal.Now.plainDateISO();
  return now.until(parsedDate, { largestUnit: 'days' }).days
})

```

but I can’t figure out how to make things work in the table.

---

<div class="post-metadata">

### Author: ![Hckr1123](https://community.silverbullet.md/user_avatar/community.silverbullet.md/hckr1123/32/915_2.png) [@Hckr1123](https://community.silverbullet.md/u/Hckr1123)
#### Post date: [January 21, 2025, 8:38pm UTC](https://community.silverbullet.md/t/day-countdown-in-a-table/1682/2 "2025-01-21T20:38:38Z")

</div>

> ```template  
> | Events | Days Left |  
> |----------|----------|  
> | Event A | {{daysTillDate(“2025-01-24”)}} |  
> | Event B | {{daysTillDate(“2025-01-28”)}} |  
> ```

This worked for me. Is this what you were looking for?

---

<div class="post-metadata">

### Author: ![docfips](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/d/f14d63/32.png) [@docfips](https://community.silverbullet.md/u/docfips)
#### Post date: [January 21, 2025, 8:46pm UTC](https://community.silverbullet.md/t/day-countdown-in-a-table/1682/3 "2025-01-21T20:46:02Z")

</div>

It is.

It didn’t cross my mind to toss it in a code box…

Thank you.
