What I’m trying to do
I have set up a meeting note template that I can trigger from a meeting_MOC using the Meta Bind button builder. Upon creation, the date and time are filled into a ‘Date & time’ property field automatically. Sometimes however, I’ll be creating a note about a meeting that happened a while back, as I regularly still have to take manual notes because my device isn’t at hand on site. In this case, I just manually overwrite the autofilled date. Within the meeting_MOC note, I also created an overview of all meetings, which I want to be able to query within a certain date range (let’s say Jan. 2025).
The only way I managed to autofill date and time upon note creation using a button is by using the Templater plugin, using <% tp.date.now(“yyyy-MM-DD HH:mm”) %> (see below for MWE). This breaks my date query: either the query returns all notes with autofilled dates, or all notes with manually set dates. This is because the two formats are different, and I’m unable to reconsile both. Any help?
The solution should allow automatic dating (1) in a property field (2) which is manually overwritable (3) and can be queried in a dataview table (4). This poses 4 design requirements which I haven’t been able to reconcile. The methods for automatic dating and querying don’t matter.
Things I have tried
MWE:
- create a note ‘DummyMeetingTemplate’ in the default template folder, which only contains the following (in source mode):
Date: <% tp.date.now(“yyyy-MM-DD HH:mm”) %>
- Create a folder called DummyMeetingFolder
- Create a note ‘DummyMeetingMOC’, which contains 3 elements:
i. A table which will hold one attempt to query the date, which will turn out to correspond to querying the default ‘Date & time’ dates:
TABLE Date from "DummyMeetingFolder" where Date >= date(2025-01-01) and Date <= date(2025-01-31)
ii. A table which will hold another attempt, which will turn out to correspond to querying tp-dates (not date type, but string type with very rigid formatting!):
TABLE dateformat(date(Date, "yyyy-MM-dd HH:mm"), "dd/MM/yyyy") as "Date" from "DummyMeetingFolder" where date(Date, "yyyy-MM-dd HH:mm") >= date(2025-01-01) and date(Date, "yyyy-MM-dd HH:mm") <= date(2025-01-31)
iii. A button to create a note from the template, using the Meta Bind plugin’s Button Builder (Install plugin > Ctrl+P > Meta Bind Button Builder > AddAction: TemplaterCreateNote > Template File: DummyMeetingMOC and Folder: DummyMeetingFolder > Copy to Clipboard > paste in DummyMeetingMOC)
4. From within the DummyMeetingMOC, click the button twice. Notice how two files are created in the DummyMeetingFolder. Both should have the dates autofilled. In the DummyMeetingMOC, both notes should appear in one of the tables (not both). Now manually change the date of one of both to any other date within the same month. This file jumps tables. Problem.
Note:
- The MWE only works if you’re executing the steps in Jan. 2025. Adapt the dataview table queries according to your own month.
- Using ctime or whatever does not work, as I want to be able to manually set the meeting date
- I’ve tried a lot of combinations of time formatting, and none worked. I haven’t been systematic, but I doubt time formatting is the answer here.
- I’ve tried several configurations. The MWE displays the one which highlights the problem best. The end result should clearly highlight the difference in date formatting, which is even a data typing problem (see step 3ii.).