mcndt / obsidian-toggl-integration

A Toggl integration plugin for the popular knowledge base application Obsidian.
GNU General Public License v3.0
267 stars 19 forks source link

bug: Error Rendering daily reports #74

Closed Gourneyz closed 11 months ago

Gourneyz commented 2 years ago

I generate logs in my daily notes by using this in the template:

LIST
FROM {{date}} to {{date}} 

It works for the current day, but previous days display this error:

Error while rendering report ☹️ Please report this exception on GitHub.

TypeError: Cannot read properties of undefined (reading 'data') at groupByDate (eval at (app://obsidian.md/app.js:1:1433729), :31926:10) at getListGroups (eval at (app://obsidian.md/app.js:1:1433729), :31841:17) at Object.$$self.$$.update (eval at (app://obsidian.md/app.js:1:1433729), :31972:36) at init$1 (eval at (app://obsidian.md/app.js:1:1433729), :894:8) at new TogglListReport (eval at (app://obsidian.md/app.js:1:1433729), :31987:3) at create_if_block_1 (eval at (app://obsidian.md/app.js:1:1433729), :32178:21) at Object.p (eval at (app://obsidian.md/app.js:1:1433729), :32375:18) at update (eval at (app://obsidian.md/app.js:1:1433729), :577:36) at flush (eval at (app://obsidian.md/app.js:1:1433729), :544:13)

othman316 commented 2 years ago

same here, it doesn´t even render the current day? lmk if you found any solution

mcndt commented 2 years ago

Hey Gourneyz and Ahmed316d3v,

Are you able to check if these errors occur on version 0.7.3 of the plugin or if they only started at 0.8.0?

You can download the plugin files for v0.7.3 here: https://github.com/mcndt/obsidian-toggl-integration/releases/tag/0.7.3

Simple download the files main.js, manifest.json and styles.css and replace them in the plugin's folder in your Obsidian vault.

I might have dropped the ball in the last update. If you can confirm 0.7.3 works without these updates, I will simply revert the live version until I can polish 0.8.0 better. I unfortunately don't have time for plugin development until June.

Gourneyz commented 2 years ago

Yep, 0.7.3 no longer has those issues, thanks!

yanlogan commented 2 years ago

Can confirm as well with 0.7.3 version, had the same problem! Works fine :)

mcndt commented 2 years ago

As discussed, you can now update to the latest version 0.8.1 which is a revert to the 0.7.3 plugin code.

Sorry for the trouble, I am too busy to fix the actual issue so this is the best I can do until the summer break.

ricraftis commented 1 year ago

I found this old post and I am having a similar problem in my Daily Note using version 0.10. I . TODAY will render today's report irrespective of the date of the Daily Note being viewed. I tried

LIST FROM {{date}} to {{date}

Returning Error message:

"{{date}}" is not a keyword, ISO-formatted date, decimal number or string. Hint: strings must be wrapped in quotation marks, dates must be formatted as YYYY-MM-DD and numbers should have no leading zeros.

What would be the correct syntax to render the Daily Note's time report on the date of the Daily Note and also the weekly report back one week from the Daily Note's date?

Cheers,

mcndt commented 11 months ago

Hi @ricraftis

You're correct, the "TODAY" keyword generates a report for today's date, not the date of your daily note.

Using the {{date}} template value probably doesn't work because I assume Obsidian ignores code blocks by default when generating notes from templates.

I would recommend looking into the Templater plugin (https://github.com/SilentVoid13/Templater) to set up more advanced templates like you are looking for.

mcndt commented 11 months ago

Closing this issue since the original discussion concerns an outdated version of the plugin, but don't hesitate to start a new thread if you need more help!

ricraftis commented 11 months ago

Hi Maxime,

Thanks for the reply. I have found that putting FROM {{date}} to {{date}} in the Daily note template fixes this issue, but it confused me for a while because it wouldn't render in the template. Further confused because I had the date set in my Daily Notes plugin as YYYY-MM-DD dddd. Once I changed the date format to YYYY-MM-DD standard and realised the template won't render until it's called, it was all sorted.

My daily notes are now rendering perfectly.

Cheers,

On Sun, 23 Jul 2023 at 20:32, Maxime Cannoodt @.***> wrote:

Hi @ricraftis https://github.com/ricraftis

You're correct, the "TODAY" keyword generates a report for today's date, not the date of your daily note.

Using the {{date}} template value probably doesn't work because I assume Obsidian ignores code blocks by default when generating notes from templates.

I would recommend looking into the Templater plugin ( https://github.com/SilentVoid13/Templater) to set up more advanced templates like you are looking for.

— Reply to this email directly, view it on GitHub https://github.com/mcndt/obsidian-toggl-integration/issues/74#issuecomment-1646804681, or unsubscribe https://github.com/notifications/unsubscribe-auth/A47JI5KHIYZTSH6Z2TFGPBLXRT4T5ANCNFSM5QNJEQXA . You are receiving this because you were mentioned.Message ID: @.***>

-- Ric Raftis Ph: +61 407412100 Web: Ric Raftis Consulting http://ricraftis.au/ Have a chat: My Calendar https://ricraftis.au/calendar/ Timezone: Melbourne, Australia https://www.timeanddate.com/time/zone/australia/bendigo