I want to update a date linked by ngModel, using ngx-bootstrap datepicker, then send it in a PUT request to my Django backend. But the date format keeps getting changed from YYYY-MM-DD (2019-08-13) to the full javascript datestring (2019-08-13T23:00:00.000Z) which wont let me send the PUT request then.
I have tried nearly everything I can find on all other problems and it just doesnt work, nothing will let me select it as YYYY-MM-DD and keep it that way in the PUT request. Any help greatly appreciated.
<input class="form-control"
#dp="bsDatepicker"
bsDatepicker
[(ngModel)]="project.Start_Date2"
name="Start_Date2"
[bsConfig]="{
dateInputFormat: 'YYYY-MM-DD',
isAnimated: true,
containerClass: 'theme-default'
}">
I just want to be able to send my PUT request with the date format as YYYY-MM-DD. I am not sure if ngx-bootstrap will do it because when I pick a date with it, it converts it to the long string which then doesn't work in the PUT request.