JavaScript - 日期轉字串,字串轉日期,增減天數
var date1 = '2018-05-16';
var objDate = new Date(date1 );
objDate .setDate(objDate .getDate() + 1);
var mm = objDate .getMonth() + 1;
var dd = objDate .getDate();
var date2 = [objDate .getFullYear(),
(mm>9 ? '' : '0') + mm,
(dd>9 ? '' : '0') + dd
].join('-');