import { UiElement } from './ui-element'; export class DateInput extends UiElement { private currentDate: any = ''; constructor( private label: string, private elementId: string, private value: any, private containerId: string, private disabled: string, private hidden: string, private required: string, private language: string = 'en') { super(elementId, containerId, ''); this.createElement(this.getTemplate()); } formatDate() { let date = new Date(); this.value = date.toISOString().slice(0, 10); } dateChange($event){ console.log($event) } public getTemplate() { let requiredClass: string = ""; const doneText = this.language === 'en' ? 'Done' : 'تم'; const cancelText = this.language === 'en' ? 'Cancel' : 'إلغاء'; if (this.disabled == "N") { this.disabled = "disabled" } else { this.disabled = "" } if (this.hidden == "N") { this.hidden = "display:none;" } else { this.hidden = "" } if (this.value == "currentDate") { this.formatDate(); } else { if (this.value) { this.value = new Date(this.value).toISOString().slice(0, 10); } } if (this.required == 'Y') requiredClass = "requiredClass" const template = // "
"; "