Interface for creating daily notes in Obsidian
npm install obsidian-daily-notes-interface
A collection of utility functions for working with dates and daily notes in Obsidian plugins. It reads from the user's Daily Notes settings to provide a consistent interface.
The best way to use this package is to add it to your dependencies:
``if you use npm:
npm install --save obsidian-daily-notes-interface
Utilities
$3
Replicates the Daily Notes plugin in Obsidian but allows creating a note for any day (past or present).
#### Usage
`ts
import { createDailyNote } from 'obsidian-daily-notes-interface';
...
const date = moment();
createDailyNote(date);
`> Note: if you pass in a past or future date, {{date}} tokens in the user's daily notes template will resolve to the correct date.
$3
Check if the user has the Daily Notes plugin enabled.
$3
Returns a map of all daily notes, keyed off by their
dateUID.$3
Returns the Daily Note for a given
Moment. For performance reasons, this requires passing in the collection of all daily notes.$3
Returns the settings stored in the Daily Notes plugin (
format, folder, and template).$3
Generic utility for reading the contents of a file given it's relative path. This does not apply any transformations.
FAQ
$3
A
dateUID uniquely identifies a note, allowing for faster note lookup. It is prefixed by a granularity: day, week, month` to allow for additional supporting additional note types (the Calendar plugin uses this for Weekly Notes currently).This allows you to cache the collection of dailyNotes for a significant speed up.