strautomator / core

Strautomator Core
MIT License
41 stars 5 forks source link

Weeknumber tag is shown as year #15

Closed CGraabaek closed 1 year ago

CGraabaek commented 1 year ago

Issue

Weeknumber returns year instead of weeknumber.

The issue can be seen in my activity log, where I use the weekOfYear tag. image

Expected behaviour

The tag is Pfitz 18/55 W${weekOfYear}R, and should return Pfitz 18/55 W2R instead if Pfitz 18/55 W2023R.

Solution

Apparently dayjs function weekOfYear returns the year instead of the week. Use the function week() instead

igoramadas commented 1 year ago

Thanks for the fix. I just found out that the WeekYear plugin is missing on the core, but I had it installed globally on my dev environment so it passed the tests. A good reminder to reset the environment here to mirror exactly what's in production :-)