private int startOfWeekOffset(int day,int dow){
  int weekStart=Math.floorMod(day - dow,7);
  int offset=-weekStart;
  if (weekStart + 1 > weekDef.getMinimalDaysInFirstWeek()) {
    offset=7 - weekStart;
  }
  return offset;
}

private int startOfWeekOffset ( int day , int dow ) { int weekStart = Math . floorMod ( day - dow , 7 ) ; int offset = - weekStart ; if ( weekStart + 1 > weekDef . getMinimalDaysInFirstWeek ( ) ) { offset = 7 - weekStart ; } return offset ; }
returns an offset to align week start with a day of month or day of year .
