Closed JBusch closed 7 years ago
@JBusch I would not like to add these properties to DynamicInputModel
as this is not part of the HTML 5 standard. However I'm planning to introduce a DynamicDatePickerModel
as soon as Material 2 does deliver a corresponding UI control. There, your proposal could make a nice addition.
Thanks for your ideas!
well, do i read it false then? https://www.w3.org/TR/html51/sec-forms.html#date-state-typedate
The following common input element content attributes, IDL attributes, and methods apply to the element: autocomplete, list, max, min, readonly, required, and step content attributes; list, value, valueAsDate, and valueAsNumber IDL attributes; select(), stepDown(), and stepUp() methods.
@JBusch Oh, you're right. I originally thought that min and max attributes would only apply to input type number. Nevertheless you can already set min
and max
properties for DynamicInputModel
.
you can already set min and max properties for DynamicInputModel
well, those on the input model are numbers. we would need dates here though, right?
@JBusch I'm not sure. Shouldn't it be number | string
? (see http://www.w3schools.com/tags/att_input_min.asp)
Jap, valid date string is fine. i'll check it out.
Yes, it already works just by setting the min attribute on the input model!
well, min and max are only number right now, which throws an error:
export interface DynamicInputModelConfig extends DynamicInputControlModelConfig {
accept?: string;
inputType?: string;
list?: Array<string>;
max?: number;
min?: number;
multiple?: boolean;
pattern?: string;
step?: number;
}
export declare class DynamicInputModel extends DynamicInputControlModel<any> {
accept: string | null;
inputType: string;
files: FileList | null;
list: Array<string> | null;
max: number | null;
min: number | null;
multiple: boolean | null;
pattern: string | null;
step: number | null;
private listId;
readonly type: string;
constructor(config: DynamicInputModelConfig, cls?: ClsConfig);
}
A DynamicDatePickerModel would be really nice btw. Type "date" is so sad right now :(
@JBusch types will be adjusted in the next patch version 1.3.2
Wouldn't it be nice, if we could set min and max for date inputs? we could easily set them which would make a lot of validation obsolete imho.