mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
saving selections adds to the existing date note instead of creating new one each time
This commit is contained in:
@@ -6,7 +6,6 @@ const {TRILIUM_DATA_DIR} = require('./data_dir');
|
||||
|
||||
const APP_DB_VERSION = 136;
|
||||
const SYNC_VERSION = 9;
|
||||
const CLIPPER_VERSION = 1;
|
||||
|
||||
module.exports = {
|
||||
appVersion: packageJson.version,
|
||||
|
||||
@@ -29,6 +29,7 @@ async function getNoteStartingWith(parentNoteId, startsWith) {
|
||||
AND branches.isDeleted = 0`, [parentNoteId]);
|
||||
}
|
||||
|
||||
/** @return {Promise<Note>} */
|
||||
async function getRootCalendarNote() {
|
||||
// some caching here could be useful (e.g. in CLS)
|
||||
let rootNote = await attributeService.getNoteWithLabel(CALENDAR_ROOT_LABEL);
|
||||
@@ -47,6 +48,7 @@ async function getRootCalendarNote() {
|
||||
return rootNote;
|
||||
}
|
||||
|
||||
/** @return {Promise<Note>} */
|
||||
async function getYearNote(dateStr, rootNote) {
|
||||
if (!rootNote) {
|
||||
rootNote = await getRootCalendarNote();
|
||||
@@ -79,6 +81,7 @@ async function getMonthNoteTitle(rootNote, monthNumber, dateObj) {
|
||||
.replace(/{month}/g, monthName);
|
||||
}
|
||||
|
||||
/** @return {Promise<Note>} */
|
||||
async function getMonthNote(dateStr, rootNote) {
|
||||
const monthStr = dateStr.substr(0, 7);
|
||||
const monthNumber = dateStr.substr(5, 2);
|
||||
@@ -116,6 +119,7 @@ async function getDateNoteTitle(rootNote, dayNumber, dateObj) {
|
||||
.replace(/{weekDay2}/g, weekDay.substr(0, 2));
|
||||
}
|
||||
|
||||
/** @return {Promise<Note>} */
|
||||
async function getDateNote(dateStr) {
|
||||
const rootNote = await getRootCalendarNote();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user