liamcain / obsidian-calendar-plugin

Simple calendar widget for Obsidian.
MIT License
1.65k stars 145 forks source link

`Start week on` creating a bug #372

Open juanbretti opened 2 months ago

juanbretti commented 2 months ago

Describe the bug

The settings window is missing some options.

Also, there is an error at the "Obsidian Developer Console".

Steps to reproduce

  1. Start obsidian
  2. Set a different start of the week date at Settings > Calendar > Start week on
  3. Close and reopen obsidian
  4. Check Calendar settings. Now the settings are missing elements
  5. Check the Obsidian Developer Console

Expected behavior

No error while opening the application. A complete list of settings for Calendar.

Screenshots

I get these errors:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'dow')
    at CalendarSettingsTab.addWeekStartSetting (plugin:calendar:814:66)
    at CalendarSettingsTab.display (plugin:calendar:775:14)
    at SettingsSearch.getTabResources (plugin:settings-search:229:15)
    at SettingsSearch.buildPluginResources (plugin:settings-search:129:12)
    at eval (plugin:settings-search:131:29)
plugin:calendar:814 Uncaught TypeError: Cannot read properties of undefined (reading 'dow')
    at CalendarSettingsTab.addWeekStartSetting (plugin:calendar:814:66)
    at CalendarSettingsTab.display (plugin:calendar:775:14)
    at t.openTab (app.js:1:3043848)
    at t.eval (plugin:settings-search:288:23)
    at t.wrapper [as openTab] (plugin:settings-search:59:20)
    at HTMLDivElement.<anonymous> (app.js:1:3042168)
    at HTMLDivElement.<anonymous> (app.js:1:3042168)
addWeekStartSetting @ plugin:calendar:814
display @ plugin:calendar:775
t.openTab @ app.js:1
eval @ plugin:settings-search:288
wrapper @ plugin:settings-search:59
(anonymous) @ app.js:1
plugin:calendar:814 Uncaught TypeError: Cannot read properties of undefined (reading 'dow')
    at CalendarSettingsTab.addWeekStartSetting (plugin:calendar:814:66)
    at CalendarSettingsTab.display (plugin:calendar:775:14)
    at t.openTab (app.js:1:3043848)
    at t.eval (plugin:settings-search:288:23)
    at t.wrapper [as openTab] (plugin:settings-search:59:20)
    at t.openTabById (app.js:1:3044481)
    at t.eval (plugin:settings-search:295:23)
    at t.wrapper [as openTabById] (plugin:settings-search:59:20)
    at SettingsSearch.detachFromDesktop (plugin:settings-search:375:24)
    at SettingsSearch.detach (plugin:settings-search:379:10)
    at SettingsSearch.onChange (plugin:settings-search:385:12)
    at eval (plugin:settings-search:315:12)
    at t.onChanged (app.js:1:1355828)
    at t.onChanged (app.js:1:1356668)
Uncaught TypeError: Cannot read properties of undefined (reading 'dow')
    at CalendarSettingsTab.addWeekStartSetting (plugin:calendar:814:66)
    at CalendarSettingsTab.display (plugin:calendar:775:14)
    at t.openTab (app.js:1:3043848)
    at HTMLDivElement.<anonymous> (app.js:1:3042168)
addWeekStartSetting @ plugin:calendar:814
display @ plugin:calendar:775
t.openTab @ app.js:1
(anonymous) @ app.js:1

The Calendar settings looks like:

image

And sometimes like:

image

image

Environment (please specify)

OS

Windows

Obsidian Version (e.g. v0.10.6)

SYSTEM INFO:
    Obsidian version: v1.7.3
    Installer version: v1.6.7
    Operating system: Windows 11 Pro 10.0.22631
    Login status: logged in
    Language: en
    Catalyst license: insider
    Insider build toggle: on
    Live preview: on
    Base theme: dark
    Community theme: none
    Snippets enabled: 4
    Restricted mode: off
    Plugins installed: 18
    Plugins enabled: 18
        1: Text Format v3.1.0
        2: Omnivore v1.10.4
        3: Templater v2.7.2
        4: Dataview v0.5.67
        5: Calendar v1.5.10
        6: Settings Search v1.3.10
        7: Homepage v4.0.5
        8: Text Extractor v0.5.2
        9: Omnisearch v1.24.1
        10: Natural Language Dates v0.6.2
        11: Mind Map v1.1.0
        12: Excalidraw v2.5.0
        13: Git v2.27.0
        14: Tag Wrangler v0.6.1
        15: Tasks v7.10.2
        16: Plugin Update Tracker v1.5.2
        17: Image Converter v1.1.7
        18: Enhancing Export v1.10.8

Also tested on the Sandbox, with the same error:

SYSTEM INFO:
    Obsidian version: v1.7.3
    Installer version: v1.6.7
    Operating system: Windows 11 Pro 10.0.22631
    Login status: logged in
    Language: en
    Catalyst license: insider
    Insider build toggle: on
    Live preview: on
    Base theme: adapt to system
    Community theme: none
    Snippets enabled: 0
    Restricted mode: off
    Plugins installed: 1
    Plugins enabled: 1
        1: Calendar v1.5.10

Theme (if applicable):

No theme.

baodrate commented 2 months ago

I believe this bug only exists on Obsidian >=v1.7.2

And I can only reproduce it if the Calendar pane is not focused when starting Obsidian

iiz00 commented 1 month ago

I may have missed this issue, but it might be the same problem: https://github.com/liamcain/obsidian-calendar-plugin/issues/375