Fixed incorrect month calculation and initial date format of from date