Validating date in java script