I'm trying got do a query of work records for 7 days prior to a user specified date (i.e. the last 7 days). I've had some success using the $datetool from the wiki script extension and subtracting the number of milliseconds in 7 days (1209600000), but I really want an interval from 12:01AM to 11:59PM. I would like to use something more exact like Julian days but I cannot find a way to make that work. I've tried the following code but I always get the date to be Dec 31, 1969, likely because I'm not preserving the date object.
Code: Select all
#set($julianDATE = $dateTool.format('D',$dateTool.toDate($sysDate)))
#set($def7days = $mathTool.sub($numberTool.toNumber($julianDATE), $numberTool.toNumber("7")))
#set($weekEarly = $dateTool.format('yyyy',$dateTool.toCalendar($def7days )))
7 Days earlier is: $weekEarly\\
Does anyone have any ideas?