Skip to content

Dynamically calculating countdown and countup days in siyuan-note

License

Notifications You must be signed in to change notification settings

Achuan-2/siyuan-widget-dayCounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 13, 2024
1674635 · Aug 13, 2024

History

36 Commits
Apr 5, 2024
Jul 31, 2024
Apr 5, 2024
Jul 31, 2024
Apr 5, 2024
Apr 6, 2024
Aug 13, 2024
Apr 10, 2024
Jul 31, 2024
Apr 5, 2024
Aug 13, 2024

Repository files navigation

中文

💌 Origin

I have always been envious of the dynamic calendar icon in Wolai, but unfortunately, there are no related widgets in Obsidian. With the help of GPT, I developed a countdown widget.

Due to my weak front-end skills and lack of familiarity with Obsidian's API calls, I managed to piece things together successfully, and I have to admit, I am quite impressed with myself.

✨ Interface Preview

17123494514451712349450900.png

17123494224531712349422113.png

🐯 Main Features

  • Supports specifying a date for dynamic countdown and count-up calculations, relies on JavaScript code, does not depend on the network, and allows adding specific event names.

    • If the specified date is earlier than today's date, it counts up.
    • If the specified date is later than today's date, it counts down.
  • Supports setting background color for some beautification.

  • Configuration supports automatic saving to block attributes in Obsidian, ensuring permanent retention in notes.

  • Supports exporting templates for loading configurations, facilitating repeated calls for specific countdown/count-up dates.

🐛 Known Issues

  • The text is designed to be relatively large, so the widget block is not suitable if resized too small.
  • The Color Picker for setting colors does not support pasting colors.
  • To ensure that the widget and template can be saved and read block attributes correctly during the initial load, a delay of 500ms is added, resulting in slower display.

If anyone knows how to solve the above issues, please feel free to let me know. Your help is greatly appreciated.

❤ Acknowledgements

☎️ Feedback

Feel free to raise an issue on GitHub or contact me via email.