Page History
Document Generator allows rendering tests based on JavaScript. The notation is:
%{<Javascript>} |
Examples:
Code Block | ||||
---|---|---|---|---|
| ||||
%{( new Date()).getDate() + "/" + (( new Date()).getMonth()+ 1 ) + "/" + ( new Date()).getFullYear()} |
...
Code Block | ||||
---|---|---|---|---|
| ||||
%{var months = new Array( 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'Jun' , 'Jul' , 'Aug' , 'Sep' , 'Oct' , 'Nov' , 'Dec' ); var dateParts = '${dateformat("d“d-MMMMM-yyyy HH:mm:ssss”):Created}'.split( '-' ); var month = dateParts[ 1 ]; var yearday = dateParts[ 0 ] ; var dayyear = dateParts[ 2 ].split( ' ' )[ 0 ]; months[Number(month) - 1 ] + ' ' + day + ', ' + year;} |
Code Block | ||||
---|---|---|---|---|
| ||||
%{( '${Focus}' .length > 0 ) ? 'Focus: ${Focus}' : 'Focus not Available' } |