Documentation
¶
Index ¶
- Constants
- func FindNextNote(date time.Time, noteType NoteType, dir string, searchWindowDays int) (string, error)
- func FindNoteByDate(date time.Time, noteType NoteType, dir string, searchWindowDays int) (string, error)
- func GenerateFilename(date time.Time) string
- func ParseDateFromFilename(filename string) (time.Time, error)
- type NoteType
Constants ¶
View Source
const (
// DateFormat is the format used for note filenames (YYYY-MM-DD)
DateFormat = "2006-01-02"
)
Variables ¶
This section is empty.
Functions ¶
func FindNextNote ¶
func FindNextNote(date time.Time, noteType NoteType, dir string, searchWindowDays int) (string, error)
FindNextNote finds the next note file after the given date within the search window.
Parameters:
- date: the starting date
- noteType: the type of note (journal or standup)
- dir: the directory to search in
- searchWindowDays: how many days forward to search
Returns:
- the absolute path to the found note file
- error if no note found within search window
func FindNoteByDate ¶
func FindNoteByDate(date time.Time, noteType NoteType, dir string, searchWindowDays int) (string, error)
FindNoteByDate finds a note file for the given date, with fallback to previous dates within the search window if the exact date doesn't exist.
Parameters:
- date: the target date to find
- noteType: the type of note (journal or standup)
- dir: the directory to search in
- searchWindowDays: how many days back to search if exact date not found
Returns:
- the absolute path to the found note file
- error if no note found within search window or other errors
func GenerateFilename ¶
GenerateFilename generates a filename for a note of the given date
Types ¶
Click to show internal directories.
Click to hide internal directories.