var Unibase; (function (Unibase) { let Forms; (function (Forms) { let Controls; (function (Controls) { class TimePicker { init(formpropertyid, prop, callback) { var instance = TimePicker.Instance(); instance.loadControlSettings(prop.ControlJsonText, prop.FormPropertyId); instance.loadPropertySettings(prop.PropertySettings, prop.FormPropertyId); var formid = $("#time_" + prop.DocPropertyName).parents('.formValidate').attr('id'); var errormsg = $("#" + formid).find('.bizgaze_FormErrorMessages').attr('id'); if (callback != null) callback(); } loadControl(containerid, prop) { var regExpr = ""; var ErrMsg = ""; var validationlist = prop.Validations; if (validationlist != null) { for (var i = 0; i < validationlist.length; i++) { regExpr += validationlist[i].RegularExp + '||'; ErrMsg += validationlist[i].ErrorMessage + '||'; } } var Isrequired = prop.IsRequired != true ? 'hidden' : ''; var requiredClass = prop.IsRequired != true ? '' : 'required'; var reqMark = prop.IsRequired != true ? '' : '*'; var CurrentStageId = $("#hf_" + $("#hfLayout_InstalledPageId").val() + "_StageId").val(); if (prop.IncludedStages != null && prop.IncludedStages != "") { var StagesForRequired = prop.IncludedStages.split('|'); Isrequired = StagesForRequired.find(x => x == CurrentStageId) ? '' : 'hidden'; requiredClass = StagesForRequired.find(x => x == CurrentStageId) ? 'required' : ''; reqMark = StagesForRequired.find(x => x == CurrentStageId) ? '*' : ''; } if (prop.ExcludedStages != null && prop.ExcludedStages != "") { var ExcludedStages = prop.ExcludedStages.split('|'); Isrequired = ExcludedStages.find(x => x == CurrentStageId) ? 'hidden' : ''; requiredClass = ExcludedStages.find(x => x == CurrentStageId) ? '' : 'required'; reqMark = ExcludedStages.find(x => x == CurrentStageId) ? '' : '*'; } let ControlId = 'txt_' + prop.DocPropertyId; if (prop.IsRequired) requiredClass = 'required'; const { helpTooltipHtml, helpTextHtml } = Unibase.Platform.Forms.Components.FormViewer.Instance().getControlHelpHtml(prop); let html = '
' + '' + '
' + ' ' + '
' + helpTextHtml + '
'; $("#" + containerid).append(html); } loadControlSettings(controlsettingjson, formpropertyid) { return null; } loadPropertySettings(propertysettings, formpropertyid) { return null; } bindEditFormDetails(formpropertyid, propval, DocPropertyName) { var time = propval.split(" "); let timeVal = time[1]; let meridiem = time[2]; if (typeof meridiem != "undefined") { let [hours, minutes] = timeVal.split(':'); let formattedTime = ""; if (meridiem == 'PM') { if (hours === '12') { hours = '00'; } hours = parseInt(hours, 10) + 12; formattedTime = `${hours}:${minutes}`; time[1] = formattedTime; } else if (hours.length == 1) { hours = "0" + hours; formattedTime = `${hours}:${minutes}`; time[1] = formattedTime; } } $("#time_" + DocPropertyName).val(time[1]); } static Instance() { if (this.instance === undefined) { this.instance = new TimePicker(); } return this.instance; } } Controls.TimePicker = TimePicker; })(Controls = Forms.Controls || (Forms.Controls = {})); })(Forms = Unibase.Forms || (Unibase.Forms = {})); })(Unibase || (Unibase = {}));