allow specifying rootNote for date API functions, #3237

This commit is contained in:
zadam
2022-10-26 14:23:56 +02:00
parent c7acfd4d4e
commit 4e3d48fe7d
8 changed files with 88 additions and 73 deletions

View File

@@ -332,6 +332,7 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} date in YYYY-MM-DD format
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
* @deprecated use getDayNote instead
*/
@@ -342,6 +343,7 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} date in YYYY-MM-DD format
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
*/
this.getDayNote = dateNoteService.getDayNote;
@@ -350,6 +352,7 @@ function BackendScriptApi(currentNote, apiParams) {
* Returns today's day note. If such note doesn't exist, it is created.
*
* @method
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
*/
this.getTodayNote = dateNoteService.getTodayNote;
@@ -359,7 +362,8 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} date in YYYY-MM-DD format
* @param {object} options - "startOfTheWeek" - either "monday" (default) or "sunday"
* @param {object} [options] - "startOfTheWeek" - either "monday" (default) or "sunday"
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
*/
this.getWeekNote = dateNoteService.getWeekNote;
@@ -369,6 +373,7 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} date in YYYY-MM format
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
*/
this.getMonthNote = dateNoteService.getMonthNote;
@@ -378,6 +383,7 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} year in YYYY format
* @param {Note} [rootNote] - specify calendar root note, normally leave empty to use default calendar
* @returns {Note|null}
*/
this.getYearNote = dateNoteService.getYearNote;