It's really not about Axios. Axios is just using JSON.stringify
on a request object and JSON.stringify
converts dates into ISO 8601 format. If you want different format, don't pass a Date - format it yourself and pass a string to Axios instead of Date
Basic Date formatting is easy, you don't need Moment.js. For more advanced formating, date-fns
is much better/smaller (with support for tree-shaking)
myDateFormat = function(d) {
return d.getFullYear() + "/" + ("0" + d.getDate()).slice(-2) + "/" + ("0"+(d.getMonth()+1)).slice(-2);
}
var d1 = new Date(Date.now())
console.log(d1)
console.log(myDateFormat(d1))
Also consider changing your API to use more standard date format....