Skip to content

Commit

Permalink
Clarify datetime defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhacks committed Apr 13, 2024
1 parent b811c08 commit 6d6ab29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,10 @@ z.string().regex(regex);
z.string().includes(string);
z.string().startsWith(string);
z.string().endsWith(string);
z.string().datetime(); // ISO 8601; default is without UTC offset, see below for options
z.string().date(); // ISO short date format.
z.string().time(); // time of day in 24-hour format, see below for options.
z.string().ip(); // defaults to IPv4 and IPv6, see below for options
z.string().datetime(); // ISO 8601; by default only `Z` timezone allowed
z.string().date(); // ISO date format (YYYY-MM-DD)
z.string().time(); // ISO time format (HH:mm:ss[.SSSSSS])
z.string().ip(); // defaults to allow both IPv4 and IPv6

// transformations
z.string().trim(); // trim whitespace
Expand Down
9 changes: 5 additions & 4 deletions deno/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ There are a growing number of tools that are built atop or support Zod natively!
- [`zod-prisma-types`](https://github.com/chrishoermann/zod-prisma-types) Create Zod types from your Prisma models.
- [`quicktype`](https://app.quicktype.io/): Convert JSON objects and JSON schemas into Zod schemas.
- [`@sanity-typed/zod`](https://github.com/saiichihashimoto/sanity-typed/tree/main/packages/zod): Generate Zod Schemas from [Sanity Schemas](https://www.sanity.io/docs/schema-types).
- [`java-to-zod`](https://github.com/ivangreene/java-to-zod): Convert POJOs to Zod schemas

#### Mocking

Expand Down Expand Up @@ -854,10 +855,10 @@ z.string().regex(regex);
z.string().includes(string);
z.string().startsWith(string);
z.string().endsWith(string);
z.string().datetime(); // ISO 8601; default is without UTC offset, see below for options
z.string().date(); // ISO short date format.
z.string().time(); // time of day in 24-hour format, see below for options.
z.string().ip(); // defaults to IPv4 and IPv6, see below for options
z.string().datetime(); // ISO 8601; by default only `Z` timezone allowed
z.string().date(); // ISO date format (YYYY-MM-DD)
z.string().time(); // ISO time format (HH:mm:ss[.SSSSSS])
z.string().ip(); // defaults to allow both IPv4 and IPv6

// transformations
z.string().trim(); // trim whitespace
Expand Down

0 comments on commit 6d6ab29

Please sign in to comment.