docs(user): document calendar interaction on mobile

This commit is contained in:
Elian Doran 2025-12-04 09:22:25 +02:00
parent c4a426566f
commit dd3233a556
No known key found for this signature in database
4 changed files with 390 additions and 334 deletions

View File

@ -6,369 +6,412 @@
a start date and optionally an end date, as an event.</p> a start date and optionally an end date, as an event.</p>
<p>The Calendar view has multiple display modes:</p> <p>The Calendar view has multiple display modes:</p>
<ul> <ul>
<li>Week view, where all the 7 days of the week (or 5 if the weekends are <li data-list-item-id="e304b5ae296d7f47b813dcd8cf2dbba42">Week view, where all the 7 days of the week (or 5 if the weekends are
hidden) are displayed in columns. This mode allows entering and displaying hidden) are displayed in columns. This mode allows entering and displaying
time-specific events, not just all-day events.</li> time-specific events, not just all-day events.</li>
<li>Month view, where the entire month is displayed and all-day events can <li data-list-item-id="ea8d70da10fa78ede209782b485e2de49">Month view, where the entire month is displayed and all-day events can
be inserted. Both time-specific events and all-day events are listed.</li> be inserted. Both time-specific events and all-day events are listed.</li>
<li>Year view, which displays the entire year for quick reference.</li> <li
<li>List view, which displays all the events of a given month in sequence.</li> data-list-item-id="e057acab031bcf780ce3055e534ab2d61">Year view, which displays the entire year for quick reference.</li>
<li
data-list-item-id="e5528ab7e56ada969592f5d35896a4808">List view, which displays all the events of a given month in sequence.</li>
</ul> </ul>
<p>Unlike other Collection view types, the Calendar view also allows some <p>Unlike other Collection view types, the Calendar view also allows some
kind of interaction, such as moving events around as well as creating new kind of interaction, such as moving events around as well as creating new
ones.</p> ones.</p>
<h2>Creating a calendar</h2> <h2>Creating a calendar</h2>
<table> <figure class="table">
<thead> <table>
<tr> <thead>
<th></th> <tr>
<th></th> <th>&nbsp;</th>
<th></th> <th>&nbsp;</th>
</tr> <th>&nbsp;</th>
</thead> </tr>
<tbody> </thead>
<tr> <tbody>
<td>1</td> <tr>
<td> <td>1</td>
<img src="2_Calendar_image.png"> <td>
</td> <img src="2_Calendar_image.png">
<td>The Calendar View works only for Collection note types. To create a new </td>
note, right click on the note tree on the left and select Insert note after, <td>The Calendar View works only for Collection note types. To create a new
or Insert child note and then select <em>Collection</em>.</td> note, right click on the note tree on the left and select Insert note after,
</tr> or Insert child note and then select <em>Collection</em>.</td>
<tr> </tr>
<td>2</td> <tr>
<td> <td>2</td>
<img src="3_Calendar_image.png"> <td>
</td> <img src="3_Calendar_image.png">
<td>Once created, the “View type” of the Collection needs changed to “Calendar”, </td>
by selecting the “Collection Properties” tab in the ribbon.</td> <td>Once created, the “View type” of the Collection needs changed to “Calendar”,
</tr> by selecting the “Collection Properties” tab in the ribbon.</td>
</tbody> </tr>
</table> </tbody>
</table>
</figure>
<h2>Creating a new event/note</h2> <h2>Creating a new event/note</h2>
<ul> <ul>
<li>Clicking on a day will create a new child note and assign it to that particular <li data-list-item-id="ed78c7591e6504413d89bf60a172ba7fa">Clicking on a day will create a new child note and assign it to that particular
day. day.
<ul> <ul>
<li>You will be asked for the name of the new note. If the popup is dismissed <li data-list-item-id="e9313832f770bbe02f6dbfdce57cb040c">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.</li> by pressing the close button or escape, then the note will not be created.</li>
</ul> </ul>
</li> </li>
<li>It's possible to drag across multiple days to set both the start and end <li data-list-item-id="e154d333887462e26c059d7b3218ffd10">It's possible to drag across multiple days to set both the start and end
date of a particular note. date of a particular note.
<br> <br>
<img src="Calendar_image.png"> <img src="Calendar_image.png">
</li> </li>
<li>Creating new notes from the calendar will respect the <code>~child:template</code> relation <li data-list-item-id="e8685250a40c8a75bf4a44ba3c4218495">Creating new notes from the calendar will respect the <code>~child:template</code> relation
if set on the Collection note.</li> if set on the Collection note.</li>
</ul> </ul>
<h2>Interacting with events</h2> <h2>Interacting with events</h2>
<ul> <ul>
<li>Hovering the mouse over an event will display information about the note. <li data-list-item-id="ef3868587f3133abbb6a43f1e7ba73df4">Hovering the mouse over an event will display information about the note.
<br> <br>
<img src="7_Calendar_image.png"> <img src="7_Calendar_image.png">
</li> </li>
<li>Left clicking the event will open a&nbsp;<a class="reference-link" href="#root/_help_ZjLYv08Rp3qC">Quick edit</a>&nbsp;to <li data-list-item-id="e0349fc14f198e77629a20fce7b910cbd">Left clicking the event will open a&nbsp;<a class="reference-link" href="#root/_help_ZjLYv08Rp3qC">Quick edit</a>&nbsp;to
edit the note in a popup while allowing easy return to the calendar by edit the note in a popup while allowing easy return to the calendar by
just dismissing the popup. just dismissing the popup.
<ul> <ul>
<li>Middle clicking will open the note in a new tab.</li> <li data-list-item-id="e40934ee8189ac129ce9a62f1a34f90fd">Middle clicking will open the note in a new tab.</li>
<li>Right click will offer more options including opening the note in a new <li data-list-item-id="ed673e7b92f8713cfa950d6030deeb658">Right click will offer more options including opening the note in a new
split or window.</li> split or window.</li>
</ul> </ul>
</li> </li>
<li>Drag and drop an event on the calendar to move it to another day.</li> <li data-list-item-id="e42434d681c96273852be7111b2464e66">Drag and drop an event on the calendar to move it to another day.</li>
<li>The length of an event can be changed by placing the mouse to the right <li
data-list-item-id="ec6982b2bdebadd048f01b2c9d5204375">The length of an event can be changed by placing the mouse to the right
edge of the event and dragging the mouse around.</li> edge of the event and dragging the mouse around.</li>
</ul> </ul>
<h2>Interaction on mobile</h2>
<p>When Trilium is on mobile, the interaction with the calendar is slightly
different:</p>
<ul>
<li data-list-item-id="e9eccdc329cafb680914a2fea2bf3b967">Clicking on an event triggers the contextual menu, including the option
to open in&nbsp;<a class="reference-link" href="#root/pOsGYCXsbNQG/gh7bpGYxajRS/wArbEsdSae6g/_help_ZjLYv08Rp3qC">Quick edit</a>.</li>
<li
data-list-item-id="e095306ea6783bd216f3848b3d5b6bcba">To insert a new event, touch and hold the empty space. When successful,
the empty space will become colored to indicate the selection.
<ul>
<li data-list-item-id="e678eb6949bb0dcb609880b66f4c218b8">Before releasing, drag across multiple spaces to create multi-day events.</li>
<li
data-list-item-id="eb77c1f5e90700a75c40fd0dab32a9266">When released, a prompt will appear to enter the note title.</li>
</ul>
</li>
<li data-list-item-id="e824cd65431fa336433aa1e4186c1578d">To move an existing event, touch and hold the event until the empty space
near it will become colored.
<ul>
<li data-list-item-id="e13dbb47246890b5f93404cf3e34feb3f">At this point the event can be dragged across other days on the calendar.</li>
<li
data-list-item-id="e011cdfec5a11fc783c5cc0acb2b704e1">Or the event can be resized by tapping on the small circle to the right
end of the event.</li>
<li data-list-item-id="ea38d2059d0736ad6d172bbb9f1cde4aa">To exit out of editing mode, simply tap the empty space anywhere on the
calendar.</li>
</ul>
</li>
</ul>
<h2>Configuring the calendar view</h2> <h2>Configuring the calendar view</h2>
<p>In the <em>Collections</em> tab in the&nbsp;<a class="reference-link" href="#root/_help_BlN9DFI679QC">Ribbon</a>, <p>In the <em>Collections</em> tab in the&nbsp;<a class="reference-link" href="#root/_help_BlN9DFI679QC">Ribbon</a>,
it's possible to adjust the following:</p> it's possible to adjust the following:</p>
<ul> <ul>
<li>Hide weekends from the week view.</li> <li data-list-item-id="e5226aa5761f9b2fd47d0c38c252e7f74">Hide weekends from the week view.</li>
<li>Display week numbers on the calendar.</li> <li data-list-item-id="e62c9e62cfbc2d6e2e4587cfce90143a0">Display week numbers on the calendar.</li>
</ul> </ul>
<h2>Configuring the calendar using attributes</h2> <h2>Configuring the calendar using attributes</h2>
<p>The following attributes can be added to the Collection type:</p> <p>The following attributes can be added to the Collection type:</p>
<table> <figure
<thead> class="table">
<tr> <table>
<th>Name</th> <thead>
<th>Description</th> <tr>
</tr> <th>Name</th>
</thead> <th>Description</th>
<tbody> </tr>
<tr> </thead>
<td><code>#calendar:hideWeekends</code> <tbody>
</td> <tr>
<td>When present (regardless of value), it will hide Saturday and Sundays <td><code>#calendar:hideWeekends</code>
from the calendar.</td> </td>
</tr> <td>When present (regardless of value), it will hide Saturday and Sundays
<tr> from the calendar.</td>
<td><code>#calendar:weekNumbers</code> </tr>
</td> <tr>
<td>When present (regardless of value), it will show the number of the week <td><code>#calendar:weekNumbers</code>
on the calendar.</td> </td>
</tr> <td>When present (regardless of value), it will show the number of the week
<tr> on the calendar.</td>
<td><code>#calendar:initialDate</code> </tr>
</td> <tr>
<td>Change the date the calendar opens on. When not present, the calendar <td><code>#calendar:initialDate</code>
opens on the current date.</td> </td>
</tr> <td>Change the date the calendar opens on. When not present, the calendar
<tr> opens on the current date.</td>
<td><code>#calendar:view</code> </tr>
</td> <tr>
<td> <td><code>#calendar:view</code>
<p>Which view to display in the calendar:</p> </td>
<ul> <td>
<li><code>timeGridWeek</code> for the <em>week</em> view;</li> <p>Which view to display in the calendar:</p>
<li><code>dayGridMonth</code> for the <em>month</em> view;</li> <ul>
<li><code>multiMonthYear</code> for the <em>year</em> view;</li> <li data-list-item-id="e2cd230dc41f41fe91ee74d7d1fa87372"><code>timeGridWeek</code> for the <em>week</em> view;</li>
<li><code>listMonth</code> for the <em>list</em> view.</li> <li data-list-item-id="eee1dba4c6cc51ebd53d0a0dd52044cd6"><code>dayGridMonth</code> for the <em>month</em> view;</li>
</ul> <li data-list-item-id="ed8721a76a1865dac882415f662ed45b9"><code>multiMonthYear</code> for the <em>year</em> view;</li>
<p>Any other value will be dismissed and the default view (month) will be <li data-list-item-id="edf09a13759102d98dac34c33eb690c05"><code>listMonth</code> for the <em>list</em> view.</li>
used instead.</p> </ul>
<p>The value of this label is automatically updated when changing the view <p>Any other value will be dismissed and the default view (month) will be
using the UI buttons.</p> used instead.</p>
</td> <p>The value of this label is automatically updated when changing the view
</tr> using the UI buttons.</p>
<tr> </td>
<td><code>~child:template</code> </tr>
</td> <tr>
<td>Defines the template for newly created notes in the calendar (via dragging <td><code>~child:template</code>
or clicking).</td> </td>
</tr> <td>Defines the template for newly created notes in the calendar (via dragging
</tbody> or clicking).</td>
</table> </tr>
<p>In addition, the first day of the week can be either Sunday or Monday </tbody>
and can be adjusted from the application settings.</p> </table>
<h2>Configuring the calendar events using attributes</h2> </figure>
<p>For each note of the calendar, the following attributes can be used:</p> <p>In addition, the first day of the week can be either Sunday or Monday
<table> and can be adjusted from the application settings.</p>
<thead> <h2>Configuring the calendar events using attributes</h2>
<tr> <p>For each note of the calendar, the following attributes can be used:</p>
<th>Name</th> <figure
<th>Description</th> class="table">
</tr> <table>
</thead> <thead>
<tbody> <tr>
<tr> <th>Name</th>
<td><code>#startDate</code> <th>Description</th>
</td> </tr>
<td>The date the event starts, which will display it in the calendar. The </thead>
format is <code>YYYY-MM-DD</code> (year, month and day separated by a minus <tbody>
sign).</td> <tr>
</tr> <td><code>#startDate</code>
<tr> </td>
<td><code>#endDate</code> <td>The date the event starts, which will display it in the calendar. The
</td> format is <code>YYYY-MM-DD</code> (year, month and day separated by a minus
<td>Similar to <code>startDate</code>, mentions the end date if the event spans sign).</td>
across multiple days. The date is inclusive, so the end day is also considered. </tr>
The attribute can be missing for single-day events.</td> <tr>
</tr> <td><code>#endDate</code>
<tr> </td>
<td><code>#startTime</code> <td>Similar to <code>startDate</code>, mentions the end date if the event spans
</td> across multiple days. The date is inclusive, so the end day is also considered.
<td>The time the event starts at. If this value is missing, then the event The attribute can be missing for single-day events.</td>
is considered a full-day event. The format is <code>HH:MM</code> (hours in </tr>
24-hour format and minutes).</td> <tr>
</tr> <td><code>#startTime</code>
<tr> </td>
<td><code>#endTime</code> <td>The time the event starts at. If this value is missing, then the event
</td> is considered a full-day event. The format is <code>HH:MM</code> (hours in
<td>Similar to <code>startTime</code>, it mentions the time at which the event 24-hour format and minutes).</td>
ends (in relation with <code>endDate</code> if present, or <code>startDate</code>).</td> </tr>
</tr> <tr>
<tr> <td><code>#endTime</code>
<td><code>#color</code> </td>
</td> <td>Similar to <code>startTime</code>, it mentions the time at which the event
<td>Displays the event with a specified color (named such as <code>red</code>, <code>gray</code> or ends (in relation with <code>endDate</code> if present, or <code>startDate</code>).</td>
hex such as <code>#FF0000</code>). This will also change the color of the </tr>
note in other places such as the note tree.</td> <tr>
</tr> <td><code>#color</code>
<tr> </td>
<td><code>#calendar:color</code> <td>Displays the event with a specified color (named such as <code>red</code>, <code>gray</code> or
</td> hex such as <code>#FF0000</code>). This will also change the color of the
<td>Similar to <code>#color</code>, but applies the color only for the event note in other places such as the note tree.</td>
in the calendar and not for other places such as the note tree. (<em>Deprecated</em>)</td> </tr>
</tr> <tr>
<tr> <td><code>#calendar:color</code>
<td><code>#iconClass</code> </td>
</td> <td>Similar to <code>#color</code>, but applies the color only for the event
<td>If present, the icon of the note will be displayed to the left of the in the calendar and not for other places such as the note tree. (<em>Deprecated</em>)</td>
event title.</td> </tr>
</tr> <tr>
<tr> <td><code>#iconClass</code>
<td><code>#calendar:title</code> </td>
</td> <td>If present, the icon of the note will be displayed to the left of the
<td>Changes the title of an event to point to an attribute of the note other event title.</td>
than the title, can either a label or a relation (without the <code>#</code> or <code>~</code> symbol). </tr>
See <em>Use-cases</em> for more information.</td> <tr>
</tr> <td><code>#calendar:title</code>
<tr> </td>
<td><code>#calendar:displayedAttributes</code> <td>Changes the title of an event to point to an attribute of the note other
</td> than the title, can either a label or a relation (without the <code>#</code> or <code>~</code> symbol).
<td>Allows displaying the value of one or more attributes in the calendar See <em>Use-cases</em> for more information.</td>
like this:&nbsp;&nbsp;&nbsp;&nbsp; </tr>
<br> <tr>
<br> <td><code>#calendar:displayedAttributes</code>
<img src="9_Calendar_image.png">&nbsp;&nbsp; </td>
<br> <td>Allows displaying the value of one or more attributes in the calendar
<br><code>#weight="70" #Mood="Good" #calendar:displayedAttributes="weight,Mood"</code>&nbsp;&nbsp; like this:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br> <br>
<br>It can also be used with relations, case in which it will display the <br>
title of the target note:&nbsp;&nbsp;&nbsp; <img src="9_Calendar_image.png">&nbsp;&nbsp;&nbsp;
<br> <br>
<br><code>~assignee=@My assignee #calendar:displayedAttributes="assignee"</code> <br><code>#weight="70" #Mood="Good" #calendar:displayedAttributes="weight,Mood"</code>&nbsp;&nbsp;&nbsp;
</td> <br>
</tr> <br>It can also be used with relations, case in which it will display the
<tr> title of the target note:&nbsp;&nbsp;&nbsp;&nbsp;
<td><code>#calendar:startDate</code> <br>
</td> <br><code>~assignee=@My assignee #calendar:displayedAttributes="assignee"</code>
<td>Allows using a different label to represent the start date, other than <code>startDate</code> (e.g. <code>expiryDate</code>). </td>
The label name <strong>must not be</strong> prefixed with <code>#</code>. </tr>
If the label is not defined for a note, the default will be used instead.</td> <tr>
</tr> <td><code>#calendar:startDate</code>
<tr> </td>
<td><code>#calendar:endDate</code> <td>Allows using a different label to represent the start date, other than <code>startDate</code> (e.g. <code>expiryDate</code>).
</td> The label name <strong>must not be</strong> prefixed with <code>#</code>.
<td>Similar to <code>#calendar:startDate</code>, allows changing the attribute If the label is not defined for a note, the default will be used instead.</td>
which is being used to read the end date.</td> </tr>
</tr> <tr>
<tr> <td><code>#calendar:endDate</code>
<td><code>#calendar:startTime</code> </td>
</td> <td>Similar to <code>#calendar:startDate</code>, allows changing the attribute
<td>Similar to <code>#calendar:startDate</code>, allows changing the attribute which is being used to read the end date.</td>
which is being used to read the start time.</td> </tr>
</tr> <tr>
<tr> <td><code>#calendar:startTime</code>
<td><code>#calendar:endTime</code> </td>
</td> <td>Similar to <code>#calendar:startDate</code>, allows changing the attribute
<td>Similar to <code>#calendar:startDate</code>, allows changing the attribute which is being used to read the start time.</td>
which is being used to read the end time.</td> </tr>
</tr> <tr>
</tbody> <td><code>#calendar:endTime</code>
</table> </td>
<td>Similar to <code>#calendar:startDate</code>, allows changing the attribute
<h2>How the calendar works</h2> which is being used to read the end time.</td>
<p> </tr>
<img src="11_Calendar_image.png"> </tbody>
</p> </table>
<p>The calendar displays all the child notes of the Collection that have </figure>
a <code>#startDate</code>. An <code>#endDate</code> can optionally be added.</p> <h2>How the calendar works</h2>
<p>If editing the start date and end date from the note itself is desirable, <p>
the following attributes can be added to the Collection note:</p><pre><code class="language-text-x-trilium-auto">#viewType=calendar #label:startDate(inheritable)="promoted,alias=Start Date,single,date" <img src="11_Calendar_image.png">
</p>
<p>The calendar displays all the child notes of the Collection that have
a <code>#startDate</code>. An <code>#endDate</code> can optionally be added.</p>
<p>If editing the start date and end date from the note itself is desirable,
the following attributes can be added to the Collection note:</p><pre><code class="language-text-x-trilium-auto">#viewType=calendar #label:startDate(inheritable)="promoted,alias=Start Date,single,date"
#label:endDate(inheritable)="promoted,alias=End Date,single,date" #label:endDate(inheritable)="promoted,alias=End Date,single,date"
#hidePromotedAttributes </code></pre> #hidePromotedAttributes </code></pre>
<p>This will result in:</p> <p>This will result in:</p>
<p> <p>
<img src="10_Calendar_image.png"> <img src="10_Calendar_image.png">
</p> </p>
<p>When not used in a Journal, the calendar is recursive. That is, it will <p>When not used in a Journal, the calendar is recursive. That is, it will
look for events not just in its child notes but also in the children of look for events not just in its child notes but also in the children of
these child notes.</p> these child notes.</p>
<h2>Use-cases</h2> <h2>Use-cases</h2>
<h3>Using with the Journal / calendar</h3> <h3>Using with the Journal / calendar</h3>
<p>It is possible to integrate the calendar view into the Journal with day <p>It is possible to integrate the calendar view into the Journal with day
notes. In order to do so change the note type of the Journal note (calendar notes. In order to do so change the note type of the Journal note (calendar
root) to Collection and then select the Calendar View.</p> root) to Collection and then select the Calendar View.</p>
<p>Based on the <code>#calendarRoot</code> (or <code>#workspaceCalendarRoot</code>) <p>Based on the <code>#calendarRoot</code> (or <code>#workspaceCalendarRoot</code>)
attribute, the calendar will know that it's in a calendar and apply the attribute, the calendar will know that it's in a calendar and apply the
following:</p> following:</p>
<ul> <ul>
<li>The calendar events are now rendered based on their <code>dateNote</code> attribute <li data-list-item-id="ef8dd9e289abf6cb973bd379d219170ae">The calendar events are now rendered based on their <code>dateNote</code> attribute
rather than <code>startDate</code>.</li> rather than <code>startDate</code>.</li>
<li>Interactive editing such as dragging over an empty era or resizing an <li data-list-item-id="e35671ad2eee19bba69bb31f3f33cce37">Interactive editing such as dragging over an empty era or resizing an
event is no longer possible.</li> event is no longer possible.</li>
<li>Clicking on the empty space on a date will automatically open that day's <li data-list-item-id="e8930686b36fb7fa36d123f9f202cbc75">Clicking on the empty space on a date will automatically open that day's
note or create it if it does not exist.</li> note or create it if it does not exist.</li>
<li>Direct children of a day note will be displayed on the calendar despite <li data-list-item-id="edc838e74ed3479fe2f0fbfaef462dbbb">Direct children of a day note will be displayed on the calendar despite
not having a <code>dateNote</code> attribute. Children of the child notes not having a <code>dateNote</code> attribute. Children of the child notes
will not be displayed.</li> will not be displayed.</li>
</ul> </ul>
<img src="8_Calendar_image.png" width="1217" <p>
height="724"> <img src="8_Calendar_image.png" width="1217"
height="724">
<h3>Using a different attribute as event title</h3> </p>
<p>By default, events are displayed on the calendar by their note title. <h3>Using a different attribute as event title</h3>
However, it is possible to configure a different attribute to be displayed <p>By default, events are displayed on the calendar by their note title.
instead.</p> However, it is possible to configure a different attribute to be displayed
<p>To do so, assign <code>#calendar:title</code> to the child note (not the instead.</p>
calendar/Collection note), with the value being <code>name</code> where <code>name</code> can <p>To do so, assign <code>#calendar:title</code> to the child note (not the
be any label (make not to add the <code>#</code> prefix). The attribute can calendar/Collection note), with the value being <code>name</code> where <code>name</code> can
also come through inheritance such as a template attribute. If the note be any label (make not to add the <code>#</code> prefix). The attribute can
does not have the requested label, the title of the note will be used instead.</p> also come through inheritance such as a template attribute. If the note
<table> does not have the requested label, the title of the note will be used instead.</p>
<thead> <figure
<tr> class="table">
<th>&nbsp;</th> <table>
<th>&nbsp;</th> <thead>
</tr> <tr>
</thead> <th>&nbsp;</th>
<tbody> <th>&nbsp;</th>
<tr> </tr>
<td><pre><code class="language-text-x-trilium-auto">#startDate=2025-02-11 #endDate=2025-02-13 #name="My vacation" #calendar:title="name"</code></pre> </thead>
</td> <tbody>
<td> <tr>
<p>&nbsp;</p> <td><pre><code class="language-text-x-trilium-auto">#startDate=2025-02-11 #endDate=2025-02-13 #name="My vacation" #calendar:title="name"</code></pre>
<figure class="image image-style-align-center"> </td>
<img style="aspect-ratio:445/124;" src="5_Calendar_image.png" <td>
width="445" height="124"> <p>&nbsp;</p>
</figure> <figure class="image image-style-align-center">
</td> <img style="aspect-ratio:445/124;" src="5_Calendar_image.png"
</tr> width="445" height="124">
</tbody> </figure>
</table> </td>
</tr>
<h3>Using a relation attribute as event title</h3> </tbody>
<p>Similarly to using an attribute, use <code>#calendar:title</code> and set </table>
it to <code>name</code> where <code>name</code> is the name of the relation </figure>
to use.</p> <h3>Using a relation attribute as event title</h3>
<p>Moreover, if there are more relations of the same name, they will be displayed <p>Similarly to using an attribute, use <code>#calendar:title</code> and set
as multiple events coming from the same note.</p> it to <code>name</code> where <code>name</code> is the name of the relation
<table> to use.</p>
<thead> <p>Moreover, if there are more relations of the same name, they will be displayed
<tr> as multiple events coming from the same note.</p>
<th>&nbsp;</th> <figure class="table">
<th>&nbsp;</th> <table>
</tr> <thead>
</thead> <tr>
<tbody> <th>&nbsp;</th>
<tr> <th>&nbsp;</th>
<td><pre><code class="language-text-x-trilium-auto">#startDate=2025-02-14 #endDate=2025-02-15 ~for=@John Smith ~for=@Jane Doe #calendar:title="for"</code></pre> </tr>
</td> </thead>
<td> <tbody>
<img src="6_Calendar_image.png" width="294" <tr>
height="151"> <td><pre><code class="language-text-x-trilium-auto">#startDate=2025-02-14 #endDate=2025-02-15 ~for=@John Smith ~for=@Jane Doe #calendar:title="for"</code></pre>
</td> </td>
</tr> <td>
</tbody> <img src="6_Calendar_image.png" width="294"
</table> height="151">
<p>Note that it's even possible to have a <code>#calendar:title</code> on the </td>
target note (e.g. “John Smith”) which will try to render an attribute of </tr>
it. Note that it's not possible to use a relation here as well for safety </tbody>
reasons (an accidental recursion &nbsp;of attributes could cause the application </table>
to loop infinitely).</p> </figure>
<table> <p>Note that it's even possible to have a <code>#calendar:title</code> on the
<thead> target note (e.g. “John Smith”) which will try to render an attribute of
<tr> it. Note that it's not possible to use a relation here as well for safety
<th>&nbsp;</th> reasons (an accidental recursion &nbsp;of attributes could cause the application
<th>&nbsp;</th> to loop infinitely).</p>
</tr> <figure class="table">
</thead> <table>
<tbody> <thead>
<tr> <tr>
<td><pre><code class="language-text-x-trilium-auto">#calendar:title="shortName" #shortName="John S."</code></pre> <th>&nbsp;</th>
</td> <th>&nbsp;</th>
<td> </tr>
<figure class="image image-style-align-center"> </thead>
<img style="aspect-ratio:296/150;" src="1_Calendar_image.png" <tbody>
width="296" height="150"> <tr>
</figure> <td><pre><code class="language-text-x-trilium-auto">#calendar:title="shortName" #shortName="John S."</code></pre>
</td> </td>
</tr> <td>
</tbody> <figure class="image image-style-align-center">
</table> <img style="aspect-ratio:296/150;" src="1_Calendar_image.png"
width="296" height="150">
</figure>
</td>
</tr>
</tbody>
</table>
</figure>

View File

@ -12,21 +12,21 @@ api.log(date.format("YYYY-MM-DD"));</code></pre>
and back-end scripts.</p> and back-end scripts.</p>
<p>The following Day.js plugins are directly integrated into Trilium:</p> <p>The following Day.js plugins are directly integrated into Trilium:</p>
<ul> <ul>
<li data-list-item-id="ee48062bdf09fc0c616bb530989292b21"><a href="https://day.js.org/docs/en/plugin/advanced-format">AdvancedFormat</a> <li><a href="https://day.js.org/docs/en/plugin/advanced-format">AdvancedFormat</a>
</li> </li>
<li data-list-item-id="ed6e0cbd3a519a8720d1c9e9cc400bb04"><a href="https://day.js.org/docs/en/plugin/duration">Duration</a>, since <li><a href="https://day.js.org/docs/en/plugin/duration">Duration</a>, since
v0.100.0.</li> v0.100.0.</li>
<li data-list-item-id="e94f06e705bf337dd83b07f86d3f7adb7"><a href="https://day.js.org/docs/en/plugin/is-between">IsBetween</a> <li><a href="https://day.js.org/docs/en/plugin/is-between">IsBetween</a>
</li> </li>
<li data-list-item-id="e15e52376df80e3452567a47df67f41bd"><a href="https://day.js.org/docs/en/plugin/iso-week">IsoWeek</a> <li><a href="https://day.js.org/docs/en/plugin/iso-week">IsoWeek</a>
</li> </li>
<li data-list-item-id="e5c807c71a6b02320901809cc94dcca25"><a href="https://day.js.org/docs/en/plugin/is-same-or-after">IsSameOrAfter</a> <li><a href="https://day.js.org/docs/en/plugin/is-same-or-after">IsSameOrAfter</a>
</li> </li>
<li data-list-item-id="e1536f1bb4d9b9a40789ebe18a183e5d4"><a href="https://day.js.org/docs/en/plugin/is-same-or-before">IsSameOrBefore</a> <li><a href="https://day.js.org/docs/en/plugin/is-same-or-before">IsSameOrBefore</a>
</li> </li>
<li data-list-item-id="ec1f021ff7cf2edec5f8548843a1d5a0c"><a href="https://day.js.org/docs/en/plugin/quarter-of-year">QuarterOfYear</a> <li><a href="https://day.js.org/docs/en/plugin/quarter-of-year">QuarterOfYear</a>
</li> </li>
<li data-list-item-id="e7cf8af04f2a71d8e380627cd6d3f6d04"><a href="https://day.js.org/docs/en/plugin/utc">UTC</a> <li><a href="https://day.js.org/docs/en/plugin/utc">UTC</a>
</li> </li>
</ul> </ul>
<aside class="admonition note"> <aside class="admonition note">

View File

@ -1,5 +1,5 @@
# Documentation # Documentation
There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/rE2kRecw5n8A/Documentation_image.png" width="205" height="162"> There are multiple types of documentation for Trilium:<img class="image-style-align-right" src="api/images/MKeODWYVO3J3/Documentation_image.png" width="205" height="162">
* The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing <kbd>F1</kbd>. * The _User Guide_ represents the user-facing documentation. This documentation can be browsed by users directly from within Trilium, by pressing <kbd>F1</kbd>.
* The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers. * The _Developer's Guide_ represents a set of Markdown documents that present the internals of Trilium, for developers.

View File

@ -37,6 +37,19 @@ Unlike other Collection view types, the Calendar view also allows some kind of i
* Drag and drop an event on the calendar to move it to another day. * 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. * The length of an event can be changed by placing the mouse to the right edge of the event and dragging the mouse around.
## Interaction on mobile
When Trilium is on mobile, the interaction with the calendar is slightly different:
* Clicking on an event triggers the contextual menu, including the option to open in <a class="reference-link" href="../Basic%20Concepts%20and%20Features/Navigation/Quick%20edit.md">Quick edit</a>.
* To insert a new event, touch and hold the empty space. When successful, the empty space will become colored to indicate the selection.
* Before releasing, drag across multiple spaces to create multi-day events.
* When released, a prompt will appear to enter the note title.
* To move an existing event, touch and hold the event until the empty space near it will become colored.
* At this point the event can be dragged across other days on the calendar.
* Or the event can be resized by tapping on the small circle to the right end of the event.
* To exit out of editing mode, simply tap the empty space anywhere on the calendar.
## Configuring the calendar view ## Configuring the calendar view
In the _Collections_ tab in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>, it's possible to adjust the following: In the _Collections_ tab in the <a class="reference-link" href="../Basic%20Concepts%20and%20Features/UI%20Elements/Ribbon.md">Ribbon</a>, it's possible to adjust the following:
@ -48,7 +61,7 @@ In the _Collections_ tab in the <a class="reference-link" href="../Basic%20Conc
The following attributes can be added to the Collection type: The following attributes can be added to the Collection type:
<table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>#calendar:hideWeekends</code></td><td>When present (regardless of value), it will hide Saturday and Sundays from the calendar.</td></tr><tr><td><code>#calendar:weekNumbers</code></td><td>When present (regardless of value), it will show the number of the week on the calendar.</td></tr><tr><td><code>#calendar:initialDate</code></td><td>Change the date the calendar opens on. When not present, the calendar opens on the current date.</td></tr><tr><td><code>#calendar:view</code></td><td><p>Which view to display in the calendar:</p><ul><li><code>timeGridWeek</code> for the <em>week</em> view;</li><li><code>dayGridMonth</code> for the <em>month</em> view;</li><li><code>multiMonthYear</code> for the <em>year</em> view;</li><li><code>listMonth</code> for the <em>list</em> view.</li></ul><p>Any other value will be dismissed and the default view (month) will be used instead.</p><p>The value of this label is automatically updated when changing the view using the UI buttons.</p></td></tr><tr><td><code>~child:template</code></td><td>Defines the template for newly created notes in the calendar (via dragging or clicking).</td></tr></tbody></table> <table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><code>#calendar:hideWeekends</code></td><td>When present (regardless of value), it will hide Saturday and Sundays from the calendar.</td></tr><tr><td><code>#calendar:weekNumbers</code></td><td>When present (regardless of value), it will show the number of the week on the calendar.</td></tr><tr><td><code>#calendar:initialDate</code></td><td>Change the date the calendar opens on. When not present, the calendar opens on the current date.</td></tr><tr><td><code>#calendar:view</code></td><td><p>Which view to display in the calendar:</p><ul><li data-list-item-id="e2cd230dc41f41fe91ee74d7d1fa87372"><code>timeGridWeek</code> for the <em>week</em> view;</li><li data-list-item-id="eee1dba4c6cc51ebd53d0a0dd52044cd6"><code>dayGridMonth</code> for the <em>month</em> view;</li><li data-list-item-id="ed8721a76a1865dac882415f662ed45b9"><code>multiMonthYear</code> for the <em>year</em> view;</li><li data-list-item-id="edf09a13759102d98dac34c33eb690c05"><code>listMonth</code> for the <em>list</em> view.</li></ul><p>Any other value will be dismissed and the default view (month) will be used instead.</p><p>The value of this label is automatically updated when changing the view using the UI buttons.</p></td></tr><tr><td><code>~child:template</code></td><td>Defines the template for newly created notes in the calendar (via dragging or clicking).</td></tr></tbody></table>
In addition, the first day of the week can be either Sunday or Monday and can be adjusted from the application settings. In addition, the first day of the week can be either Sunday or Monday and can be adjusted from the application settings.
@ -66,7 +79,7 @@ For each note of the calendar, the following attributes can be used:
| `#calendar:color` | Similar to `#color`, but applies the color only for the event in the calendar and not for other places such as the note tree. (_Deprecated_) | | `#calendar:color` | Similar to `#color`, but applies the color only for the event in the calendar and not for other places such as the note tree. (_Deprecated_) |
| `#iconClass` | If present, the icon of the note will be displayed to the left of the event title. | | `#iconClass` | If present, the icon of the note will be displayed to the left of the event title. |
| `#calendar:title` | Changes the title of an event to point to an attribute of the note other than the title, can either a label or a relation (without the `#` or `~` symbol). See _Use-cases_ for more information. | | `#calendar:title` | Changes the title of an event to point to an attribute of the note other than the title, can either a label or a relation (without the `#` or `~` symbol). See _Use-cases_ for more information. |
| `#calendar:displayedAttributes` | Allows displaying the value of one or more attributes in the calendar like this:     <br> <br>![](9_Calendar_image.png)    <br> <br>`#weight="70" #Mood="Good" #calendar:displayedAttributes="weight,Mood"`   <br> <br>It can also be used with relations, case in which it will display the title of the target note:    <br> <br>`~assignee=@My assignee #calendar:displayedAttributes="assignee"` | | `#calendar:displayedAttributes` | Allows displaying the value of one or more attributes in the calendar like this:      <br> <br>![](9_Calendar_image.png)     <br> <br>`#weight="70" #Mood="Good" #calendar:displayedAttributes="weight,Mood"`    <br> <br>It can also be used with relations, case in which it will display the title of the target note:     <br> <br>`~assignee=@My assignee #calendar:displayedAttributes="assignee"` |
| `#calendar:startDate` | Allows using a different label to represent the start date, other than `startDate` (e.g. `expiryDate`). The label name **must not be** prefixed with `#`. If the label is not defined for a note, the default will be used instead. | | `#calendar:startDate` | Allows using a different label to represent the start date, other than `startDate` (e.g. `expiryDate`). The label name **must not be** prefixed with `#`. If the label is not defined for a note, the default will be used instead. |
| `#calendar:endDate` | Similar to `#calendar:startDate`, allows changing the attribute which is being used to read the end date. | | `#calendar:endDate` | Similar to `#calendar:startDate`, allows changing the attribute which is being used to read the end date. |
| `#calendar:startTime` | Similar to `#calendar:startDate`, allows changing the attribute which is being used to read the start time. | | `#calendar:startTime` | Similar to `#calendar:startDate`, allows changing the attribute which is being used to read the start time. |