I have a column start_date in my database which is of type date, now i am trying to pass this data into my javascript function but it returns other data. I tried this: Send PHP date to JavaScript date format
but it doesn't work on my case. My data looks like 2019-11-21 and my function gives me this Thu Jan 01 1987 03:00:00 GMT+1000 which is very far from my actual data. This is my javascript function:
function manageActionType(action, start_date){
console.log(new Date(Date.parse(start_date)));
}
start_datewhen passing it to your javascriptDatefunctions as it is a string<input name="action_type" type="radio" id="stepa" value="Step A" onclick="manageActionType('Step A', {{ $process->start_date }})" required />onclick="manageActionType('Step A', '{{ $process->start_date }}')"~ notice quotes around php variable!!new Date(start_date)is sufficient.