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() { const date = new Date(); this.value = date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds(); } public getTemplate() { let requiredClass = ''; let disaledClass = ''; // tslint:disable-next-line: triple-equals if (this.required == 'Y') { requiredClass = 'requiredClass'; } // tslint:disable-next-line: max-line-length 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 = '
' + ' ' + // tslint:disable-next-line: max-line-length // " "+ // tslint:disable-next-line: max-line-length '
' + this.value + '
' + '
'; // "" + // " " + this.label + "" + // tslint:disable-next-line: max-line-length // // "
" + this.value + "
" + // tslint:disable-next-line: max-line-length // "" + // tslint:disable-next-line: max-line-length // // " "+ // // " "+ // tslint:disable-next-line: max-line-length // // " "+ // "
" return template; } }