-
Any idea why this dataview JS query stoped working, and how to fix it?
It was working fine last week or so, though when the file didn't exist the text (link) showed as "| Today" instead of as "Today". Edit: I also don't think it has to do with luxon because I can't seem to get it workng with a string literal as the filename, that is in the equality, if I just hand in the string to dv.fileLink that works |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Well I did solve it by adding
Also when the file doesn't exist now the fileLink text is as it should be. But the link is to a file named "[]". |
Beta Was this translation helpful? Give feedback.
-
This behavior should not have broken, though your query looks a little wierd since it is passing an array to a functino which takes just a single string. Maybe
|
Beta Was this translation helpful? Give feedback.
Well I did solve it by adding
.toString()
, but can anyone enlighten me as to why this fixed it? What was the change that broke the query when it didn't need this typecast before? Should there have been some kind of error thrown?$= dv.fileLink(dv.pages("#dailynote").where(b => b.file.name == luxon.DateTime.now().toISODate()).file.path.toString(), false, "Today")
Also when the file doesn't exist now the fileLink text is as it should be. But the link is to a file named "[]".
Is there any way to force the link to be what was given, so that the file is created when you click it?