Skip to content

Signal Forms: Support of Temporal types for min/max validators #67643

@Alex88360

Description

@Alex88360

Which @angular/* package(s) are relevant/related to the feature request?

No response

Description

I have created datepickers based on the new Temporal api and I would like to use these types for handling min/max in my custom components.

Proposed solution

extends the types for min/max validator functions like this :

TValue extends number | string | Temporal.PlainDate | Temporal.PlainDateTime |... | null

Alternatives considered

passing manually min/max as inputs to my custom components and having custom validators.

minDate(
path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,
minValue: Temporal.PlainDate | LogicFn<TValue, Temporal.PlainDate | undefined, TPathKind>,
) {
validate(path, () => ...)
}

maxDate(
path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>,
maxValue: Temporal.PlainDate | LogicFn<TValue, Temporal.PlainDate | undefined, TPathKind>,
) {
validate(path, () => ...))
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions