Fixed undefined no of days

Fixed this issue.
add some spaces around the (), "if (..) {"