gistfile1.txt function getPrevMonth () { var date = new Date(); var year = date.getFullYear(); var month = date.getMonth() + 1; if (month === 1) { return (year - 1) + '-' + 12; } else if (month 10) { return year + '-' + (month - 1); } else
function getPrevMonth () { var date = new Date(); var year = date.getFullYear(); var month = date.getMonth() + 1; if (month === 1) { return (year - 1) + '-' + 12; } else if (month > 10) { return year + '-' + (month - 1); } else { return year + '-' + '0' + (month - 1); } }