calculate dashboard attendance time of previous month