I'm sure I'm just missing something here, but it continues to elude me.
Why does SUNDAY_START produce a week number of 1 for 2020-12-29 instead of 53?
Is it because I'm misinterpreting what the Oracle docs say? Or am I missing something further?
Details
Going to https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/temporal/WeekFields.html#SUNDAY_START shows that SUNDAY_START appears to follow the same rules as above. If I use the following code...
ZonedDateTime zdt = ZonedDateTime.ofInstant(/* representation of Dec. 29, 2020 */, ZoneId.of("UTC"));
TemporalField wn = WeekFields.SUNDAY_START.weekOfWeekBasedYear();
int weekNumber = zdt.get(wn);
Then "weekNumber" is 1, when I would expect it to be 53.
If I use WeekFields.ISO instead, I get 53; however, the definition of ISO is that it uses Monday as the start of the week, which isn't true in the case I'm dealing with and I'm unsure of future ramifications of just using ISO instead of SUNDAY_START.
What am I missing?
The Answer
Based on the comments below (thank you to Basil and Andreas), I was indeed misreading the Oracle documentation, which states:
Defined as starting on Sunday and with a minimum of 1 day in the month.
The "minimum of 1 day in the month" was the part that threw me for a loop within the context of a new year.
With the clarifications below, it's clear that since Jan. 1, 2021 occurs on a Friday, and the SUNDAY_START week starts on a Sunday, that this week would, in fact, be week number 1 in this case.
Motivation
I had originally asked this question as part of an attempt to better understand SUNDAY_START. The motivation for this was to find a way to recreate MySQL's WEEK() "mode 6" (that is, a Sunday start to the week with week 1 being the first week with 4 or more days this year).
I had forgotten about the ability to create custom week fields with a specified start day and the minimum number of days in the month for it to contain.
Still, I am grateful to have cleared up my misunderstanding of the Javadocs for SUNDAY_START, and I hope this post might be useful to someone in the future.
Thank you for everyone's comments and answers and I apologize for any initial confusion.