`;
let purl = `${document.location.origin}/notes-comment/?releasePlanID=${snapshotID}&linkedUserID=${UserId}`;
$.ajax({
url: purl,
success: function(data) {
$("#commentModal").find(".modal-body").children('.openComment').remove();
var clearedData = data.replaceAll('\t','').replaceAll('\r','').replaceAll('\b','').replaceAll('\f','');
var parsedData = JSON.parse(clearedData);
for(var i=0;i
3){
timeSys = systemCreatedDate.split(symbolToSplitonSysCreated)[2].split(' ')[1]+":"+systemCreatedDate.split(symbolToSplitonSysCreated)[3]+":"+systemCreatedDate.split(symbolToSplitonSysCreated)[4];
}
else if(systemCreatedDate.split(symbolToSplitonSysCreated).length>0 && systemCreatedDate.split(symbolToSplitonSysCreated).length<=3) timeSys = systemCreatedDate.split(symbolToSplitonSysCreated)[2].split(' ')[1];
var indexOffirstMatchCharTimeOnly = /[.\/:-]/.exec(systemCreatedDate).index;
timeSys = timeSys.replace('.',':');
let UpdatedSystemCreatedDate = systemCreatedDate.split(symbolToSplitonSysCreated)[1] +"/"+systemCreatedDate.split(symbolToSplitonSysCreated)[0]+"/"+systemCreatedDate.split(symbolToSplitonSysCreated)[2].split(' ')[0]+' '+timeSys;
var tempDate = moment(UpdatedSystemCreatedDate).format('DD/MM/YYYY hh:mm A');
let createdDate = new Date(UpdatedSystemCreatedDate);
createdDate = moment(createdDate).format('DD/MM/YYYY hh:mm A');
//--------------------------------------------------------------------------
let systemModifiedDate = parsedData.results[i].modifiedon;
var indexOffirstMatchCharSysModified = /[.\/:-]/.exec(systemModifiedDate).index;
var symbolToSplitonSysModi = systemModifiedDate[indexOffirstMatchCharSysModified];
var timeSys = '';
if( systemModifiedDate.split(symbolToSplitonSysModi).length >3){
timeSys = systemModifiedDate.split(symbolToSplitonSysModi)[2].split(' ')[1]+":"+systemModifiedDate.split(symbolToSplitonSysModi)[3]+":"+systemModifiedDate.split(symbolToSplitonSysModi)[4];
}
else if(systemModifiedDate.split(symbolToSplitonSysModi).length>0 && systemModifiedDate.split(symbolToSplitonSysModi).length<=3) timeSys = systemModifiedDate.split(symbolToSplitonSysModi)[2].split(' ')[1];
let UpdatedSystemModifiedDate = systemModifiedDate.split(symbolToSplitonSysModi)[1] +"/"+systemModifiedDate.split(symbolToSplitonSysModi)[0]+"/"+systemModifiedDate.split(symbolToSplitonSysModi)[2].split(' ')[0]+' '+timeSys;
let modifiedDate = new Date(UpdatedSystemModifiedDate);
modifiedDate = moment(modifiedDate).format('DD/MM/YYYY hh:mm A');
let contactName = DOMPurify.sanitize(parsedData.results[i].portalContact);
let splittedName = contactName.split(' ');
let initialName = '';
if(splittedName.length>0){
initialName = splittedName[0].charAt(0).toUpperCase() + splittedName[1].charAt(0).toUpperCase();
}
else initialName = splittedName[0].charAt(0).toUpperCase();
var back = ["#EBF1F9","#FDE9A3"];
var rand = back[Math.floor(Math.random() * back.length)];
var chatHead = `