# Previous/Next daily note buttons not working after clicking

**URL:** <https://forum.obsidian.md/t/previous-next-daily-note-buttons-not-working-after-clicking/59257>\
**Category:** Help\
**Tags:** daily-note\
**Created:** [May 6, 2023, 9:32am UTC](https://forum.obsidian.md/t/previous-next-daily-note-buttons-not-working-after-clicking/59257 "2023-05-06T09:32:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![koulas](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/ecb155/32.png) [@koulas](https://forum.obsidian.md/u/koulas)\
**Post date:** [May 6, 2023, 9:32am UTC](https://forum.obsidian.md/t/previous-next-daily-note-buttons-not-working-after-clicking/59257/1 "2023-05-06T09:32:07Z")

</div>

Hi folks, could anybody help me with my problem? I am trying to compose a template for my daily notes. In this template I try to add two buttons for previous and next daily note (yesterday and tomorrow).

I’ve created a template file that uses inline buttons whose code is defined in a separate file `Buttons.md`. In this file both buttons are defined:

```button
name <<
type command
action Daily notes: Open previous daily note

```

^button-prevDailyNote

```button
name >>
type command
action Daily notes: Open next daily note

```

^button-nextDailyNote

In my template I use these buttons as inline buttons. in the line starting with previous note button, followed by current date, followed by next note button. Like this:

# `button-prevDailyNote` | \<% moment(tp.file.title,‘YYYY-MM-DD’).format(“dddd, MMMM DD, YYYY”) %\> | `button-nextDailyNote`

Once I generate the daily note using template, the buttons are successfully generated,

 ![Snímek obrazovky 2023-05-06 v 17.28.04](https://forum.obsidian.md/uploads/default/original/3X/a/0/a0e6e253d2f23cc9f432f88cfc367c3f53b3f25c.png)

but they do not work after clicking. In the console I can see the following error in the buttons JS code.

 ![Snímek obrazovky 2023-05-06 v 17.28.59](https://forum.obsidian.md/uploads/default/original/3X/d/1/d10273faef61a49c3db4214fbc9fc38595d93c33.png)

Has anyone experienced the similar problem?

Thank you,

Ondrej

---

<div class="post-metadata">

**Author:** ![holroy](https://forum.obsidian.md/user_avatar/forum.obsidian.md/holroy/32/77699_2.png) [@holroy](https://forum.obsidian.md/u/holroy)\
**Post date:** [May 6, 2023, 1:59pm UTC](https://forum.obsidian.md/t/previous-next-daily-note-buttons-not-working-after-clicking/59257/2 "2023-05-06T13:59:33Z")

</div>

And where did you find/define the commands for next and prev daily notes? I can’t see them in my Obsidian, and never heard of them before.

In most cases people do some coding to get links based upon current date (or the file date) for previous and next date.

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [August 4, 2023, 2:00pm UTC](https://forum.obsidian.md/t/previous-next-daily-note-buttons-not-working-after-clicking/59257/3 "2023-08-04T14:00:32Z")

</div>

Closed on August 4, 2023, 2:00pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
