checkit icon indicating copy to clipboard operation
checkit copied to clipboard

"date" validation problem

Open pmalouin opened this issue 8 years ago • 1 comments

When updating to latest version (0.7.0), I can't get "date" validations to run properly. See:

vagrant@spitdev:/opt/app$ node
> var checkit = require('checkit');
undefined
> var c = new checkit({a:'date'});
undefined
> var body = {a:new Date()};
undefined
> c.run(body).catch(err => console.log(err));
Promise { <pending> }
> { [Error: 1 invalid values]
  message: '1 invalid values',
  errors:
   { a:
      { [Error: No validation defined for date]
        message: 'No validation defined for date',
        errors: [Object],
        key: 'a' } } }

I presume the problem is caused by commit 3307c84aed50a560260c16ea307300452dae9b20, which did not bring in the isDate method?

pmalouin avatar Dec 19 '16 14:12 pmalouin

The version 0.7 is broken use 0.6 install with: npm install [email protected]

cliedelt avatar Mar 02 '17 15:03 cliedelt