private static long firstMondayOfFirstWeek ( int year ) { final long janFirst = ymdToJulian ( year , 1 , 1 ) ; final long janFirstDow = floorMod ( janFirst + 1 , 7 ) ; // sun=0, sat=6 return janFirst + ( 11 - janFirstDow ) % 7 - 3 ; }
Returns the first day of the first week of a year . Per ISO - 8601 it is the Monday of the week that contains Jan 4 or equivalently it is a Monday between Dec 29 and Jan 4 . Sometimes it is in the year before the given year .