2.1.0 • Published 7 years ago

joi-extension-date-within v2.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

#Joi Extension Within Date

Build Status Coverage Status dependencies Status

An extension to Joi to enable checking that a date is within a number of days of another date property.

In the below example we are confirming that to is within 10 days of from

var Joi = require('joi').extend(require('joi-extension-date-within'));

var schema = Joi.object({
  from: Joi.date().required(),
  to: Joi.dateWithin().required().days(10, Joi.ref('from'))
});

var input = {
  from: new Date(2016,3,1),
  to: new Date(2016,3,30)
};

Joi.assert(input, schema)
2.1.0

7 years ago

2.0.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago