deepak_shaw
4 years agoContributor
Start and end date of a week
Hi,
How to get a start and end date of a week in a single line, I need to use this in a map snap.
Thanks,
Deepak.
Hi @deepak.shaw
Try the following expression in a Mapper snap:
"Week start: " + Date.now().minusDays(Date.now().getDay()).toLocaleDateString() + " - Week end: " + Date.now().minusDays(Date.now().getDay()).plusDays(6).toLocaleDateString()
The output should look like this:
This expression gets the current week start date (Sunday), and the current week end date (Saturday), if you want to consider other days and to modify the output, try changing the expression accordingly.
Let me know if this works for you.
Best Regards,
Aleksandar.