How to create a diary template with All Days Listed?

I am creating a monthly trade diary. Like this :point_down:

I use templater Like this :point_down:

Here the days are listed from the day I run the template.

i.e if I create the file on 8th February, it starts from 8th February only.

Is there a way to automate the listing of all days of a the current month via templater?

Try something like the following. (Note: I did not have your emojis so I just used [emoji] where they should go. Substitute the appropriate emojis in their places.)

<%*
let year = await tp.system.prompt('Year',tp.date.now('YYYY'));
let mon = await tp.system.prompt('Month',tp.date.now('M'));
tR += tp.date.now('YYYY MMMM',0,`${year}/${mon}/1`,'YYYY/M/D') + ' Trade Diary [emoji]\n\n';
let curMon = mon;
let day = 0;
while (mon == curMon)
{
   let curDay = tp.date.now('dddd, Do MMMM YYYY',day,`${year}/${mon}/1`,'YYYY/M/D');

   tR += `## [emoji] ${curDay}\n`;
   tR += '### Title\n';
   tR += 'Pre Market\n';
   tR += '   - \n';
   tR += 'Market Hours\n';
   tR += '   - \n';
   tR += 'Post Market\n';
   tR += '   - \n\n';

   day++;
   curMon = tp.date.now('M',day,`${year}/${mon}/1`,'YYYY/M/D');
}
%>
1 Like

Thanks a lot :smiling_face:, It Works Well. :pray:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.