Calendar Panel with Monday as first day of the week

The built-in calendar only supports Sunday as the first day of the week. A gentle soul, shady2k, has made a pull request that introuduces the option to change this.

The Original developer of the plugin hasn't introduced this change yet, and there is no activity since April so I'm not sure if this will ever happen. For this reason I decided to just use shady2k's version of the plugin.

Here is what I did in case anybody else is interested.

Note: I'm not a developer, if somebody has a better way to do it, please post it here, I just post this solutiuon because it's what worked for me.

Environment

In order to build in Windows, you need to install Node.js, for example in Windows I used:

choco install nodejs.install -y

If you don't use chocolatey, there are other ways to install it.

Dependencies

Install the siyuan dependencies with npm:

npm install siyuan

There is more information about plugin development here.

Build

Obtain the sources created by Shady2K:

image.png

Extract them in a folder on your machine, and go to that folder from command line.

Then you can compile with:

npm run build-only

It should look something like this:

image.png

Now you will find a file called package.zip in that folder:

image.png

Install

First of all, I would remove the original Calendar Panel plugin from the Marketplace, I'm not sure if it will cause conflicts with the modified version.

Extract to <workspace>\data\plugins under a folder called arco-calendar-with-first-day-of-the-week or whatever name you prefer.

Inside of that folder, edit the plugin.json file and modify the second line so it matches the name of the folder you use above:

{
  "name": "arco-calendar-with-first-day-of-the-week",
[...]
}

I guess we could use the original arco-calendar name for the folder so there is no need to rename the JSON file, but I'm not sure if an update on the original plugin will cause it to be overriden.

Enable

Open SiYuan, go to Settings -> Marketplace ("Trust" if you didn't enable plugins yet) -> enable the "Calendar Panel" plugin. You might need to restart SiYuan for the plugin Icon to appear.

Now you can go to the puzzle piece icon -> Calendar Panel

image.png

And select the first day of the week:

image.png

And now weeks will start on Monday! 🎉

image.png

    Welcome to here!

    Here we can learn from each other how to use SiYuan, give feedback and suggestions, and build SiYuan together.

    Signup About
    Please input reply content ...
    • glaucon1984
      VIP Warrior Author

      This trick might be useful for somebody: a second calendar panel. For me it's very annoying having to select the different notebooks from the drop-down menu. I want to see both.

      As shown above, you can edit the plugin.json and change the name of the plugin (which must match the folder name). This means you can:

      • Make a copy of the folder, call it "second-calendar-with-first-day-of-the-week"
      • Then edit the plugin.json file inside and modify the second line so it shows:
        {
        "name": "second-calendar-with-first-day-of-the-week",
        [...]
        }
        

      You might need to restart SiYuan, make change the panel position to top left/right and back to "Dock" for the second button to show up, then you can set one of them to "Right Top" and the other one to "Right Bottom", so they are both in the same dock.

      This way you can have two Calendar Panels set for two different Notebooks:

      image.png