02-28-2019 09:06 PM
Hi,
I am looking for a function which can give me the Current Week.
For instance the current date is 2019-03-01 , so the week would be Week 9 and the Previous week is Week 8.
Thanks,
Gaurav Sandil
03-04-2019 09:19 AM
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)
06-06-2022 06:56 PM
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.