I need to determine how many ISO weeks a year has.
My attempt looks like this
moment.tz(2019, "YYYY", "UTC").endOf("year").isoWeek()
But that doesn't do the job. 31st of December is ISO week 1 in some cases.
Ofc, there are probably some ugly ways to get the result, but i would like a clean code.
It doesn't seem like moment.js provides an interface for this.
This seems to be the solution (pure JS) Get weeks in year