Skip to content

Commit 9e111c9

Browse files
authored
Merge pull request #1064 from WesTyler/master
Update API.md to remove deprecated date.format syntax from an example
2 parents abfe727 + d95f3f5 commit 9e111c9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

API.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -664,9 +664,11 @@ Outputs the original untouched value instead of the casted value.
664664
- `isRaw` - whether to enable raw mode or not. Defaults to true.
665665
666666
```js
667-
const schema = {
668-
timestamp: Joi.date().format('YYYYMMDD').raw()
669-
};
667+
const timestampSchema = Joi.date().timestamp();
668+
timestampSchema.validate('12376834097810'); // { error: null, value: Sat Mar 17 2362 04:28:17 GMT-0500 (CDT) }
669+
670+
const rawTimestampSchema = Joi.date().timestamp().raw();
671+
rawTimestampSchema.validate('12376834097810'); // { error: null, value: '12376834097810' }
670672
```
671673
672674
#### `any.empty(schema)`

0 commit comments

Comments
 (0)