zincplusplus/habit-tracker

Obsidian must be restarted to update "today"

Closed this issue · 3 comments

DEFAULT_SETTINGS.lastDisplayedDate is set when the plugin loads. By default its todays date via the getTodayDate function which is sensible default behaviour.

If you leave Obsidian open across days and leave this default behaviour then the chart is never updated to reflect the current date - you have to restart Obsidian to have it update.

DEFAULT_SETTINGS should perhaps be replaced with a getDefaultSettings function so that the value for lastDisplayedDate is re-evaluated each time its used by the loadSettings method?

Very interesting. I thought if you just switch to another page and then get back to the page with habit tracker 21 it would get the right today. I'll look into it

Had some time to create a PR for this!

Thank you @middric 🎉