Calculation for particular date is not working