Open today's daily note - ability to set a time until which this opens yesterday's note

Use case or problem

I sometimes work post midnight and want to open yesterday’s daily note using the ‘Open today’s daily note’ button (because I basically still consider it within yesterday’s working time). This button opens up what is today’s note, usually creating a new one, which I don’t want

Proposed solution

Add an option to the dailies plugin to set a time until which it should still be considered the previous day

4 Likes

I’d really appreciate this as well. I work on (roughly) Australian time but keep my clocks set to my place in the US, and the window of overlap past midnight basically prevents me from comfortably using Daily Notes at all.

1 Like

I think the Daily Notes Opener Plugin will provide this for you

That daily notes opener plugin adds a lot of unnecaserry features that cannot be turned off. And it does not work with the default dark theme, so i cannot really use it well.

I would really like a setting in default obsidian for a custom date cutoff time - it should be extremely easy to implement too.

1 Like

For anyone that finds this later - i figured out how to do this with dataview. Put this snippet in your note in edit mode with ```dataviewjs above it and three backticks after it.

const adjustedTime = dv.date("now").minus({ hours: 5 });
const today = adjustedTime.toISODate();
const filePath = `Notes/Daily Notes/${today}`;
dv.el('span', `[[${filePath}|Daily Note]]`);

Feel free to adjust the filepath to match your folder structure

Here is a codeblock to show yesterday’s note with some nice conditional text:

const adjustedTime = dv.date("now").minus({ hours: 5, days: 1 });
const yesterday = adjustedTime.toISODate();
const filePath = `Notes/Daily Notes/${yesterday}`;

if (app.vault.getAbstractFileByPath(filePath + ".md")) {
   dv.el('span', `[[${filePath}|Yesterday's note]]`);
} else {
    dv.el("span", `Yesterday's note does not exist. [[${filePath}|Make it?]]`);
}

I put these links on my homepage for easy access. I suggest anyone looking for this feature do the same for now

Second this :+1:

I have two notions of ‘today’: calendar day (resets at midnight) and waking day (resets when I wake up). I’d like the daily note to reset after ~4am.