Type error fix for empty string

When input value is a empty string of spaces, date validator returns
null, and `formatted = date.format(format);` gives a type error. This
commits returns false on such cases.

Fixed indent.
Merge pull request #1270 from SergioCrisostomo/fix-1030

Type error fix for empty string on 'validate-date'