obsidian-alfred icon indicating copy to clipboard operation
obsidian-alfred copied to clipboard

Support multiple date format placeholders for daily notes

Open PaoloCentomani opened this issue 3 years ago • 3 comments

I have set up my daily notes as Dailies/YYYY/YYYY-mm-dd. This will not work with the current od script.

It can be fixed by replacing:

date_format = date_format.replace(y_char, yyyy);

with:

date_format = date_format.replaceAll(y_char, yyyy);

TY!

PaoloCentomani avatar Jan 21 '22 12:01 PaoloCentomani

Thanks! Good to know! Will patch it when I have time.

hauselin avatar Jan 24 '22 03:01 hauselin

+1. My format is YYYY/MMMM/M-D-YY (ddd) which results in the note today being named m-11-yy (Sat)

phalladar avatar Mar 11 '23 14:03 phalladar

My daily format: YYYY/MM/YYYY-MM-DD-dddd

I was able to fix this by correcting od script as bellow: CleanShot 2023-08-17 at 15 39 47@2x

Line 221 ~ 224

date_format = date_format.replaceAll(y_char, yyyy);
date_format = date_format.replaceAll(m_char, mm);
date_format = date_format.replaceAll(d_char, dd);
date_format = date_format.replaceAll(w_char, ww);

Full script attached. od_fixed.zip

I don't know how to edit the alfreadworkflow file. So could not make a PR.

minhnhut avatar Aug 17 '23 08:08 minhnhut