calendar now indicates whether date note already exists or not + tooltip

This commit is contained in:
zadam
2019-09-08 16:30:33 +02:00
parent c82de8b6b2
commit 16be0c1014
4 changed files with 41 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
"use strict";
const dateNoteService = require('../../services/date_notes');
const sql = require('../../services/sql');
async function getDateNote(req) {
return await dateNoteService.getDateNote(req.params.date);
@@ -14,8 +15,25 @@ async function getYearNote(req) {
return await dateNoteService.getYearNote(req.params.year);
}
async function getDateNotesForMonth(req) {
const month = req.params.month;
return sql.getMap(`
SELECT
attr.value AS date,
notes.noteId
FROM notes
JOIN attributes attr USING(noteId)
WHERE notes.isDeleted = 0
AND attr.isDeleted = 0
AND attr.type = 'label'
AND attr.name = 'dateNote'
AND attr.value LIKE '${month}%'`);
}
module.exports = {
getDateNote,
getMonthNote,
getYearNote
getYearNote,
getDateNotesForMonth
};