int getDayOfWeek ( Calendar calendar ) { int dayOfWeek = calendar . get ( Calendar . DAY_OF_WEEK ) - firstDayOfWeekToDraw ; dayOfWeek = dayOfWeek < 0 ? 7 + dayOfWeek : dayOfWeek ; return dayOfWeek ; }
it returns 0 - 6 where 0 is Sunday instead of 1