Fixed a couple bugs: If an invalid date is typed date becomes false and date.getTime() causes an exception. If an invalid value is typed a date can't be selected.