var oldFormatDate = function (date) {
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? '0' + m : m;
var d = date.getDate()-7;
d = d < 10 ? ('0' + d) : d;
return y + '-' + m + '-' + d;
};
var formatDate = function (date) {
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? '0' + m : m;
var d = date.getDate();
d = d < 10 ? ('0' + d) : d;
return y + '-' + m + '-' + d;
};
var date = new Date();
var oldTransDate = oldFormatDate(date);
var newTransDate = formatDate(date);
var transDate = oldTransDate +" ~ "+newTransDate;