Help - Date variable

Can somebody help me in getting last Monday date variable / function.

We have some example Javascript snippets here: https://a9t9.com/kantu/docs/selenium-ide/storeeval - for example to “Get todays date” and how to “Get yesterday’s date (-1), tomorrows date (1) or the date in 5 days (5)”. These functions should be a good starting point.

If you find a solution for your specific task, please feel free to post it here, and I can add it to the storeEval page :wink:

Hi TechSupport,
just wanted to let you know that I used one of the snippets … and improved it a little.
The snippet for current date (… date in YYYY-MM-DD format) is not 100% correct as it returns the day as a single digit when it is less then 10 (YYY-MM-D).
Also I found that it can be a lot shorter by using the slice() method…

“var now = new Date(); var m=(‘0’+(now.getMonth()+1)).slice(-2); var d=(‘0’+now.getDate()).slice(-2); now.getFullYear()+”-"+m+"-"+d;"

hey i tried using this but it says slice is not method.