-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugBug or defectBug or defect
Milestone
Description
The following code:
var Joi = require('joi');
Joi.validate('2014-12-02T11:00:20.000Z', Joi.date().iso().required());
throws:
/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/node_modules/moment/moment.js:1060
format = format.replace(localFormattingTokens, replaceLongDateForm
^
TypeError: Object /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\d))$/ has no method 'replace'
at expandFormat (/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/node_modules/moment/moment.js:1060:29)
at makeDateFromStringAndFormat (/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/node_modules/moment/moment.js:1474:18)
at makeMoment (/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/node_modules/moment/moment.js:1798:17)
at moment (/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/node_modules/moment/moment.js:1832:16)
at Object.internals.toDate (/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/lib/date.js:63:24)
at internals.Date._base (/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/lib/date.js:28:46)
at internals.Any._validate (/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/lib/any.js:371:31)
at internals.Any._validateWithOptions (/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/lib/any.js:425:23)
at root.validate (/Users/fampinheiro/Workspace/projects/t-joi/node_modules/joi/lib/index.js:102:23)
at Object.<anonymous> (/Users/fampinheiro/Workspace/projects/t-joi/index.js:2:5)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug or defectBug or defect