diff --git a/src/assets/js/utils/getBeforeDate.js b/src/assets/js/utils/getBeforeDate.js index 58fd58b1c..445e82daf 100644 --- a/src/assets/js/utils/getBeforeDate.js +++ b/src/assets/js/utils/getBeforeDate.js @@ -13,5 +13,42 @@ export default { //获取“多少天数”之前的时间 例如28天前 即days=28 let currentTime = new Date().getTime() return new Date(currentTime - 1000 * 60 * 60 * 24 * days) + }, + /** + * 获取上个月 + */ + getLastMonth:function(){ + var nowDate = new Date(); + var year = nowDate.getFullYear(); + var month = nowDate.getMonth(); + if(month == 0){ + month = 12; + year = year - 1; + } + if (month <= 9) { + month = '0' + month + } + var yyyyMM = year+"-"+month; + console.log(yyyyMM); + return yyyyMM + }, + /** + * 获取上个月月底日期 + */ + getLastMonthAndDay:function(){ + var nowDate = new Date(); + var year = nowDate.getFullYear(); + var month = nowDate.getMonth(); + if(month == 0){ + month = 12; + year = year - 1; + } + if (month <= 9) { + month = '0' + month + } + var lastDay = new Date(year,month,0); + var yyyyMMdd = year+"-"+month+"-"+lastDay.getDate(); + console.log(yyyyMMdd); + return yyyyMMdd } } diff --git a/src/views/ebiz/laurelClub/ExclusivePosters.vue b/src/views/ebiz/laurelClub/ExclusivePosters.vue index a36394e73..587823fb1 100644 --- a/src/views/ebiz/laurelClub/ExclusivePosters.vue +++ b/src/views/ebiz/laurelClub/ExclusivePosters.vue @@ -4,7 +4,7 @@