I built a lightweight wrapper for Day.js to handle complex date math and fix the ISO week-year mismatch in TiddlyWiki. I discovered that my daily journal entries weren’t getting the correct ISO week for the last days of December, so I wrapped day.js in JavaScript, since it’s modern and lightweight (~2KB).
- Demo & Install: https://dayjs-plugin-example.tiddlyhost.com/
- Source: GitHub - mblackman/tiddlywiki-dayjs-plugin: The Day.js library as a Tiddlywiki Plugin
Usage:
<<dayjs "2024-12-31" "WW-GGGG">>
// Output: 01-2025 (Correct ISO Year)
It supports standard formats (YYYY-MM-DD) and advanced tokens (Do for ordinals, Q for quarters). You can see more examples on my demo TiddlyWiki.
Let me know if there’s anything I can add to improve this wrapper.