From 34df8dbcb2b6783e2c870cc79c5aef64d38c0191 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 6 Nov 2021 21:30:38 +0000 Subject: [PATCH] docs: strictTime option --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b4706d..4386e39 100644 --- a/README.md +++ b/README.md @@ -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