Skip to content

Commit

Permalink
docs: strictTime option
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Nov 6, 2021
1 parent d1a9e36 commit 34df8db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ addFormats(ajv, {mode: "fast"})
or

```javascript
addFormats(ajv, {mode: "fast", formats: ["date", "time"], keywords: true})
addFormats(ajv, {mode: "fast", formats: ["date", "time"], keywords: true, strictTime: true})
```

In `"fast"` mode the following formats are simplified: `"date"`, `"time"`, `"date-time"`, `"uri"`, `"uri-reference"`, `"email"`. For example `"date"`, `"time"` and `"date-time"` do not validate ranges in `"fast"` mode, only string structure, and other formats have simplified regular expressions.

With `strictTime: true` option timezone becomes required in `time` and `date-time` formats, and (it also implies `full` mode for these formats).

## Tests

```bash
Expand Down

0 comments on commit 34df8db

Please sign in to comment.