MCPcopy
hub / github.com/Effect-TS/effect / DateTimeZonedFromSelf

Class DateTimeZonedFromSelf

packages/effect/src/Schema.ts:7064–7082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7062 * @since 3.10.0
7063 */
7064export class DateTimeZonedFromSelf extends declare(
7065 (u) => dateTime.isDateTime(u) && dateTime.isZoned(u),
7066 {
7067 typeConstructor: { _tag: "effect/DateTime.Zoned" },
7068 identifier: "DateTimeZonedFromSelf",
7069 description: "a DateTime.Zoned instance",
7070 pretty: (): pretty_.Pretty<dateTime.Zoned> => (dateTime) => dateTime.toString(),
7071 arbitrary: (): LazyArbitrary<dateTime.Zoned> => (fc) =>
7072 fc.tuple(
7073 fc.integer({
7074 // time zone db supports +/- 1000 years or so
7075 min: -31536000000000,
7076 max: 31536000000000
7077 }),
7078 timeZoneArbitrary(fc)
7079 ).map(([millis, timeZone]) => dateTime.unsafeMakeZoned(millis, { timeZone })),
7080 equivalence: () => dateTime.Equivalence
7081 }
7082) {}
7083
7084/**
7085 * Defines a schema that attempts to convert a `string` to a `DateTime.Zoned` instance.

Callers

nothing calls this directly

Calls 5

declareInterface · 0.85
timeZoneArbitraryFunction · 0.85
integerMethod · 0.80
toStringMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected