If your dates are already strings, you can do the following
var dates = ['1/2/12','15/5/12'];
console.log("'" + dates.join("','") + "'");
However, a cooler and more foolproof way (for the case with no dates) way would be Array.prototype.map
// Array.prototype.map returns a new array by
// mapping each element in the existing array
dates.map(function(date){
// Wrap each element of the dates array with quotes
return "'" + date + "'";
}).join(","); // Putsa comma in between every element
Or in es6 lingo
dates.map(date => `'${date}'`).join(',');
http://jsfiddle.net/yMvVh/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…