We have an API that accepts a date string as argument in the format:
2020-11-30
When we have a date object it's very easy in PowerShell to achieve the correct format:
(Get-Date).ToString('yyyy-MM-dd')
Doing this in javascript is a bit more difficult
date.toISOString() // 2020-10-28T00:00:00.000Z
How can to get rid of the time part in the string? Is there a better way to format a date in a custom matter?