I have array of dates in sql format. So dates[0]="2001-01-01", I need to format it in format: "1-Jan-12". As I found it here it should work like this.
tmpDate=Date.parse(dates[0]);
var date=tmpDate.format("dd-mm-yy");
it says: Uncaught TypeError: Object 978307200000 has no method 'format' So type of my object is string however it should be date.
console.log($.type(tmpDate));
Also says "number". Why?