Here is a function you can use to get the last day of the month:
function getLastDayOfMonth(stringDate) {
var date = qie.deduceDate(stringDate);
var cal = java.util.GregorianCalendar.getInstance();
cal.setTime(date);
return cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
}
Here is an example of how to call it:
qie.debug('2/20/2017: ' + getLastDayOfMonth('2/20/2017'));