@salesflare/joi-date-string

    2.0.2 • Public • Published

    joi-date-string

    Date string validation rule for Joi

    Build Status Greenkeeper badge

    What

    Allows you to do Joi.dateString().

    Uses moment for validation.

    How

    const myCustomJoi = Joi.extend(require('joi-date-string'));
    
    myCustomJoi.dateString().validate('2018-10-05'); // pass
    
    myCustomJoi.dateString().validate('05-10-2018'); // fail
    myCustomJoi.dateString().validate(new Date()); // fail
    myCustomJoi.dateString().validate('2018-08-02T12:09:04.378Z'); // fail
    myCustomJoi.dateString().validate('1'); // fail
    myCustomJoi.dateString().validate(1); // fail

    Install

    npm i @salesflare/joi-date-string

    DownloadsWeekly Downloads

    10

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    5.48 kB

    Total Files

    5

    Last publish

    Collaborators

    • jaspervdk
    • adrivanhoudt
    • kdeclerck