I'm trying to calculate salary of last week of employees. It means current week should not me included in the calculation. Right now I have -7 from current date to check my data. This is my code
var currentDate = new Date();
log.info(currentDate)
var requiredDate=new Date(currentDate.getFullYear(),currentDate.getMonth(),currentDate.getDate()-7)
var start=Date.parse(requiredDate)
var end=Date.parse(currentDate);
query="taskCreateTimestamp:["+start+" TO "+end+"]";
My objective is to calculate last week salary between Monday to friday. I have taken -7 to check my data only. Please help me
check this link you can get start date and end date of last week. and append time stamp '00:00:00' to start date and '23:59:59' to the end date if your data have time stamp.
get last week in javascript