I have a date as a string "20180619"
How can I convert this to 19 Jun 2018
I started by trying
var date = new Date(parseInt("20180619"));
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
console.log(d + ' ' + m + ' ' + y)
But get 1 0 1970
Edit: So there are actually 2 issues here, first is the date is the wrong format, and second get the month name. The second part is answer by the other linked question. So it just boils down to splitting the date down to it's components using one of a couple of different methods in the answers here.