import { UiElement } from "./ui-element"; // import { TranslatorService } from '../hmg-common/services/translator/translator.service'; export class TimeInput extends UiElement { // public direction: string; constructor( private label: string, private elementId: string, private value: any, private containerId: string, private disabled: string, private hidden: string, private required: string) { super(elementId, containerId, ''); // this.direction = TranslatorService.getCurrentLanguageName(); this.createElement(this.getTemplate()); } formatDate() { let date = new Date(); this.value = date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds(); } public getTemplate() { let requiredClass: string = ""; let disaledClass = ""; if (this.required == 'Y') requiredClass = "requiredClass" if (this.disabled == "N") { this.disabled = "disabled"; disaledClass = "disabled" } else { this.disabled = ""; disaledClass = "" } if (this.hidden == "N") { this.hidden = "display:none;" } else { this.hidden = "" } if (this.value == "currentTime") { this.formatDate(); } const template = "
" + " " + // " "+ "
"+this.value+"
"+ "
"; // "" + // " " + this.label + "" + // // "
" + this.value + "
" + // "" + // // " "+ // // " "+ // // " "+ // "
" return template; } }