Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Xporter allows rendering test based on Javascript JavaScript. The notation is:

%{<Javascript>}

...

Code Block
titleFormat the Creation Date in the format dd-MM-yyyy HH:mm format (01-03-1978 8:00)
collapsetrue
%{var dateTime = '${dateformat("dd-MM-yyyy HH:mm:ss"):Created}'.split( ' ' ); var date = dateTime[ 0 ]; var time = dateTime[ 1 ]; var dateParts = date.split( '-' );
 var timeParts = time.split( ':' ); dateParts[ 2 ] +  '-' + dateParts[ 1 ] +  '-' + dateParts[ 0 ] +  ' ' + timeParts[ 0 ] +  ':' + timeParts[ 1 ]} 
Code Block
titleFormat the Creation Date in the format dd-MM-yyyy format (03-01-1978)
collapsetrue
%{'${dateformat("dd-MM-yyyy HH:mm:ss"):Created}'.substring( 0 , 10 )}
Code Block
titleFormat the Creation Date in the format MMM d yyyy format (Jan 3, 1978)
collapsetrue
%{var months =  new Array( 'Jan' ,  'Feb' ,  'Mar' ,  'Apr' ,  'May' ,  'Jun' ,  'Jul' ,  'Aug' ,  'Sep' ,  'Oct' ,  'Nov' ,  'Dec' ); var dateParts
 = '${dateformat("d-MMM-yyyy HH:mm:ss}'.split( '-' ); var month = dateParts[ 1 ]; var year = dateParts[ 0 ] ; var day = dateParts[ 2 ].split( ' ' )[ 0 ];
 months[Number(month) -  1 ] +  ' ' + day +  ', ' + year;}
Code Block
titleExport the content if the field is not empty; otherwise, otherwise display other text
collapsetrue
%{( '${Focus}' .length >  0 ) ?  'Focus: ${Focus}' :  'Focus not Available' }