mirror of
https://github.com/dzeiocom/FormManager.git
synced 2025-04-23 03:12:14 +00:00
32 lines
562 B
TypeScript
32 lines
562 B
TypeScript
import { FMAssignInterface } from './../Interfaces';
|
|
import FMInput from "../FMInput"
|
|
|
|
/**
|
|
*
|
|
* @class FMDateInput
|
|
* @extends {FMInput}
|
|
*/
|
|
export default class FMDateInput extends FMInput {
|
|
|
|
setValue(value: Date|string) {
|
|
if (typeof(value) == "string") {
|
|
value = new Date(value)
|
|
}
|
|
this.element.valueAsDate = value
|
|
}
|
|
|
|
getValue(): Date {
|
|
return this.element.valueAsDate
|
|
}
|
|
|
|
getDefault(args: string): Date {
|
|
return new Date
|
|
}
|
|
}
|
|
|
|
export const FMDateInputAssignement: FMAssignInterface = {
|
|
input: FMDateInput,
|
|
type: "date",
|
|
tagName: "input"
|
|
}
|