In my Angular application, I am dealing with a date value that is stored in local storage.
My current code snippet retrieves the date like this:
$scope.selectedDate = localStorage.getItem('selDate');
The returned date from this code is '11-4-2015'.
However, what I actually need is to get this date minus 85 days.
I attempted the following:
var hearingOffset = 85;
var selectedDate = new Date(localStorage.getItem('selDate').replace(/-/g, '/') - hearingOffset);
Unfortunately, this resulted in an "Invalid Date" error.
How can I adjust the code to obtain the correct date?