function applyHero(id) {
  var user = array.personas.hero[parseInt($('#' + id + '-picker').val() - 1)];
  $('#' + id + '-name').val(user.name);
  $('#' + id + '-email').val(user.emailAddress);
  $('#' + id + '-id').val(user.contactKey);
  var seenDate = new Date(new Date() - (user.daysFirstSeen*24*60*60*1000));
  var joinDate = new Date(new Date() - (user.daysJoined*24*60*60*1000));
  var sysDate = new Date();
  $('#' + id + '-date').val(seenDate.toISOString().substring(0,16));
  $('#' + id + '-joined').val(joinDate.toISOString().substring(0,16));
  $('#' + id + '-last-seen').val(sysDate.toISOString().substring(0,16));
  $('#' + id + '-profile').find('.slds-box').animate({'backgroundColor': '#d8edff', 'borderColor':'#1589ee'},500);
  $('#' + id + '-profile').find('.slds-box').animate({'backgroundColor': '#f3f2f2', 'borderColor':'#dddbda'},1000);
}
// Function to auto-fill profile data from persona library
Function to auto-fill profile data from persona library
Function to auto - fill profile data from persona library
function applyHero(id) {
  var user = array.personas.hero[parseInt($('#' + id + '-picker').val() - 1)];
  $('#' + id + '-name').val(user.name);
  $('#' + id + '-email').val(user.emailAddress);
  $('#' + id + '-id').val(user.contactKey);
  var seenDate = new Date(new Date() - (user.daysFirstSeen*24*60*60*1000));
  var joinDate = new Date(new Date() - (user.daysJoined*24*60*60*1000));
  var sysDate = new Date();
  $('#' + id + '-date').val(seenDate.toISOString().substring(0,16));
  $('#' + id + '-joined').val(joinDate.toISOString().substring(0,16));
  $('#' + id + '-last-seen').val(sysDate.toISOString().substring(0,16));
  $('#' + id + '-profile').find('.slds-box').animate({'backgroundColor': '#d8edff', 'borderColor':'#1589ee'},500);
  $('#' + id + '-profile').find('.slds-box').animate({'backgroundColor': '#f3f2f2', 'borderColor':'#dddbda'},1000);
}
function applyHero ( id ) { var user = array . personas . hero [ parseInt ( $ ( '#' + id + '-picker' ) . val ( ) - 1 ) ] ; $ ( '#' + id + '-name' ) . val ( user . name ) ; $ ( '#' + id + '-email' ) . val ( user . emailAddress ) ; $ ( '#' + id + '-id' ) . val ( user . contactKey ) ; var seenDate = new Date ( new Date ( ) - ( user . daysFirstSeen * 24 * 60 * 60 * 1000 ) ) ; var joinDate = new Date ( new Date ( ) - ( user . daysJoined * 24 * 60 * 60 * 1000 ) ) ; var sysDate = new Date ( ) ; $ ( '#' + id + '-date' ) . val ( seenDate . toISOString ( ) . substring ( 0 , 16 ) ) ; $ ( '#' + id + '-joined' ) . val ( joinDate . toISOString ( ) . substring ( 0 , 16 ) ) ; $ ( '#' + id + '-last-seen' ) . val ( sysDate . toISOString ( ) . substring ( 0 , 16 ) ) ; $ ( '#' + id + '-profile' ) . find ( '.slds-box' ) . animate ( { 'backgroundColor' : '#d8edff' , 'borderColor' : '#1589ee' } , 500 ) ; $ ( '#' + id + '-profile' ) . find ( '.slds-box' ) . animate ( { 'backgroundColor' : '#f3f2f2' , 'borderColor' : '#dddbda' } , 1000 ) ; }
Function to auto-fill profile data from persona library
Function to auto - fill profile data from persona library