Strangely, I was aware of this, and figured no one would care or be affected! If you're a date/time person we can share horror stories - DIffering versions of Java, PHP and even SQL all are inconsistent in odd ways. I'm using the legacy SimpleDateFormat - a now defunct class extender of java.time from the way back machine.
There are a couple problems to overcome to resolve this little issue - Timezone and region. and besides the region of the local device doing the viewing, the region of the HUB.
To my knowledge, the hub doesn't check a region. It only stores a timezone. This presents a hurdle of fairly large portion - I'd need to store nearly 800 regional values to an array to get the week to correctly display! My take is the hub is US born, and I'm just gonna have to leave this alone for now, either until I get better understanding of how the region values of a hub are handled so I can pull Locale (not to be confused with TZ) - or I rewrite the app completely with DateTimeFormatter and get off the defunct SimpleDateTime.
If you're following and interested -
jshell> Locale.getDefault(); $2 ==> en_GB
It was en_GB, which means English and the United Kingdom.
Our live application is deployed inside a Docker container. I checked the default locale there. It was en_US: English and the United States.
I began to wonder if the UK and the US have different conventions for week years. So I looked online and found the excellent timeanddate.com.
The timeanddate.com 2021 UK calendar says: “Week numbers: ISO 8601 (week starts Monday) — week 1 is the first week with Thursday.”
The timeanddate.com 2021 US calendar says: “Week numbers: Week starts Sunday – week 1 is the one with January 1.”
Accordingly, Since Jan 1st was on a Saturday, in the US that was week one. Most of the world uses a 'first week to contain Thursday' but in some countries it is even different than that!
Savvytime.com give a nice display of the calendar and makes it easy to count the weeks - per them, we're in week 34...
There's also a really neat discussion of the twitter problem that crashed them a few years back - specifically because of this!
So, while I have no doubt there are conflicts with this tool, my fallback is it was written for me and my use and in the end I determine what value I'd get by working further on this - I can live with the oddity, and I hope you can too! And by that I mean if it is critical to your Rule - you'll need to apply math to it - and 'minus 1' it if you're not using US based regions. **caveat - and of course this will be wrong next year! **