Forum Discussion
gaurav_sandil
7 years agoNew Contributor III
Thanks Ajay. I tried below statement and it worked for me:
$weekstartdate =
Date.now().minusWeeks(1).withHourOfDay(0).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0)
$weekenddate = Date.now().minusWeeks(1).plusDays(6).withHourOfDay(23).withMinuteOfHour(59).withSecondOfMinute(59).withMillisOfSecond(0)
deepak_shaw
4 years agoContributor
Hi @gaurav.sandil and @Ajay_Chawda,
I think the above expression only limits to the current month, if beginning of the week falls to last month it doesn’t calculate correctly.