I would like to convert a string value that I fetch from my database and convert it to a date variable in the view using javascript
I have tried out the following code;
var date = moment({!! $cheque->cheque_date !!}).format('YYYY-MM-DD');
I am getting the following result when I console log the date variable. 1970-01-01
$cheque->cheque_datemoment(string, format)var date = moment('{!! $cheque->cheque_date !!}').format('YYYY-MM-DD');