I use the calendar plugin every day, and for a given day I would like to show a list of my contacts that has birthday that day. I have now tried to pull this off with dataviewjs.
Every contact has a page with the following type of information:
#person
born:: 2000-08-23
If I could compare the month and day of the current file with the “born” attribute of every person, then I guess I would get the desired birthday list.
If I try the following I get an error message. Apparently ‘month’ and ‘day’ doesn’t work for the object ‘p.born’.
PS: @mnvwvnm Javascript tip since I know JS is not your favorite: use const instead of let in front of variables whose values you are only setting once. (My variable naming is atrociously verbose though, don’t copy that!)
Unfortunately, I get the same error for the toFormat() inside the dv.list().
Evaluation Error: TypeError: Cannot read properties of null (reading 'toFormat')
at eval (eval at <anonymous> (plugin:dataview), <anonymous>:6:32)
at Array.filter (<anonymous>)
at Proxy.where (plugin:dataview:9414:39)
at eval (eval at <anonymous> (plugin:dataview), <anonymous>:6:6)
at DataviewInlineApi.eval (plugin:dataview:19667:16)
at evalInContext (plugin:dataview:19668:7)
at asyncEvalInContext (plugin:dataview:19678:32)
at DataviewJSRenderer.render (plugin:dataview:19699:19)
at DataviewRefreshableRenderer.maybeRefresh (plugin:dataview:19277:22)
at t.e.tryTrigger (app://obsidian.md/app.js:1:963725)
Thanks.
You’re right: JS isn’t my field at all. The fun thing is: when I do (or trying) something in JS, I always use const; in this case I suggested let following the initial query (because I really don’t know the differences… ).
At first this worked, but then it suddenly didn’t again.
Since my setup apparently is a bit buggy, I changed my workflow somewhat and implemented this great Upcoming Birthday Algorithm by @Moonbase59 on a separate page instead.