The Calendar view of Book notes will display each child note in a calendar
+ that has a start date and optionally an end date, as an event.
+
Unlike other Book view types, the Calendar view also allows some kind
+ of interaction, such as moving events around as well as creating new ones.
+
Creating a calendar
+
+
+
+
+
+
+
+
+
+
1
+
+
+
+
+
+
+
+
The Calendar View works only for Book note types. To create a new note,
+ right click on the note tree on the left and select Insert note after,
+ or Insert child note and then select Book.
+
+
+
+
+
2
+
+
+
+
+
+
Once created, the “View type” of the Book needs changed to “Calendar”,
+ by selecting the “Book Properties” tab in the ribbon.
+
+
+
+
+
Creating a new event/note
+
+
Clicking on a day will create a new child note and assign it to that particular
+ day.
+
+
You will be asked for the name of the new note. If the popup is dismissed
+ by pressing the close button or escape, then the note will not be created.
+
+
+
It's possible to drag across multiple days to set both the start and end
+ date of a particular note.
+
+
+
+
+
Interacting with events
+
+
Hovering the mouse over an event will display information about the note.
+
+
+
+
Left clicking the event will go to that note. Middle clicking will open
+ the note in a new tab and right click will offer more options including
+ opening the note in a new split or window.
+
Drag and drop an event on the calendar to move it to another day.
+
The length of an event can be changed by placing the mouse to the right
+ edge of the event and dragging the mouse around.
+
+
Configuring the calendar
+
+
The first day of the week can be either Sunday or Monday and can be adjusted
+ from the application settings.
+
+
How the calendar works
+
+ The calendar displays all the child notes of the book that have a #startDate.
+ An #endDate can optionally be added.
+
If editing the start date and end date from the note itself is desirable,
+ the following attributes can be added to the book note:
By default, events are displayed on the calendar by their note title.
+ However, it is possible to configure a different attribute to be displayed
+ instead.
+
To do so, assign #calendar:title to the child note (not the
+ calendar/book note), with the value being #name where name can
+ be any label. The attribute can also come through inheritance such as a
+ template attribute. If the note does not have the requested label, the
+ title of the note will be used instead.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Using a relation attribute as event title
+
Similarly to using an attribute, use #calendar:title and set
+ it to ~name where name is the name of the relation
+ to use.
+
Moreover, if there are more relations of the same name, they will be displayed
+ as multiple events coming from the same note.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Note that it's even possible to have a #calendar:title on the
+ target note (e.g. “John Smith”) which will try to render an attribute of
+ it. Note that it's not possible to use a relation here as well for safety
+ reasons (an accidental recursion of attributes could cause the application
+ to loop infinitely).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Book/Calendar View_image.png b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Book/Calendar View_image.png
new file mode 100644
index 000000000..d46f327a2
Binary files /dev/null and b/src/public/app/doc_notes/en/User Guide/User Guide/Note Types/Book/Calendar View_image.png differ
diff --git a/src/public/app/doc_notes/en/User Guide/navigation.html b/src/public/app/doc_notes/en/User Guide/navigation.html
index 77cf9ca53..85143e944 100644
--- a/src/public/app/doc_notes/en/User Guide/navigation.html
+++ b/src/public/app/doc_notes/en/User Guide/navigation.html
@@ -29,6 +29,12 @@
Shared notes
diff --git a/src/public/app/widgets/buttons/global_menu.ts b/src/public/app/widgets/buttons/global_menu.ts
index 9d04c8e56..67a235709 100644
--- a/src/public/app/widgets/buttons/global_menu.ts
+++ b/src/public/app/widgets/buttons/global_menu.ts
@@ -365,6 +365,7 @@ export default class GlobalMenuWidget extends BasicWidget {
this.$zoomState = this.$widget.find(".zoom-state");
this.$toggleZenMode = this.$widget.find('[data-trigger-command="toggleZenMode"');
+ this.$toggleZenMode.toggle(!utils.isMobile());
this.$widget.on("show.bs.dropdown", () => this.#onShown());
if (this.tooltip) {
this.$widget.on("hide.bs.dropdown", () => this.tooltip.enable());
diff --git a/src/public/app/widgets/view_widgets/calendar_view.ts b/src/public/app/widgets/view_widgets/calendar_view.ts
index 27ba46d74..70b68e98f 100644
--- a/src/public/app/widgets/view_widgets/calendar_view.ts
+++ b/src/public/app/widgets/view_widgets/calendar_view.ts
@@ -155,16 +155,10 @@ export default class CalendarView extends ViewMode {
async #onEventMoved(e: EventChangeArg) {
const startDate = CalendarView.#formatDateToLocalISO(e.event.start);
+ // Fullcalendar end date is exclusive, not inclusive but we store it the other way around.
let endDate = CalendarView.#formatDateToLocalISO(CalendarView.#offsetDate(e.event.end, -1));
const noteId = e.event.extendedProps.noteId;
- // Fullcalendar end date is exclusive, not inclusive but we store it the other way around.
- if (endDate) {
- const endDateParsed = new Date(endDate);
- endDateParsed.setDate(endDateParsed.getDate() - 1);
- endDate = CalendarView.#formatDateToLocalISO(endDateParsed);
- }
-
// Don't store the end date if it's empty.
if (endDate === startDate) {
endDate = undefined;