Remove redundant spaces left in formatDate()

This bug put redundant spaces to input element, causing validation error if used under some web framework.