Skip to content

Latest commit

 

History

History
executable file
·
23 lines (15 loc) · 431 Bytes

API.md

File metadata and controls

executable file
·
23 lines (15 loc) · 431 Bytes

Compatibility

This version requires joi v17 or newer.

Usage

const Joi = require('joi')
    .extend(require('@joi/date'));

const schema = Joi.date().format('YYYY-MM-DD');

Rules

date.format(format)

Specifies the allowed date format:

  • format - string that follows the date-fns format.
const schema = Joi.date().format('YYYY-MM-DD HH:mm');