There is a reason; date.format("d") returns 0 for Sunday, 1 for Monday, etc. This way I can directly use it as an index when incrementing the counter.