Commit c1485ac5 authored by 袁玲利's avatar 袁玲利

消费报告日期格式优化

parent 95271cd4
...@@ -1867,11 +1867,11 @@ export default { ...@@ -1867,11 +1867,11 @@ export default {
let arr = this.cateringAbnormalGroupList; let arr = this.cateringAbnormalGroupList;
// arr = arr.sort((a,b) => Date.parse(b.statisticalDate) - Date.parse(a.statisticalDate)) // arr = arr.sort((a,b) => Date.parse(b.statisticalDate) - Date.parse(a.statisticalDate))
if(arr.length){ if(arr.length){
// arr = arr.map(x => (x.date = moment(x.date).format('MM-DD'))) // arr = arr.map(x => (x.date = moment(x.date).format('MM/DD')))
arr.sort((a, b) => a.statisticalDate.localeCompare(b.statisticalDate)); arr.sort((a, b) => a.statisticalDate.localeCompare(b.statisticalDate));
let str = ""; let str = "";
arr.forEach((x) => { arr.forEach((x) => {
let date = moment(x.date).format("M.D"); let date = moment(x.statisticalDate).format("M.D");
str = str + date + ","; str = str + date + ",";
}); });
str = str.substring(0, str.length - 1); str = str.substring(0, str.length - 1);
...@@ -1936,7 +1936,7 @@ export default { ...@@ -1936,7 +1936,7 @@ export default {
); );
let arr = this.cateringAbnormalGroupList; let arr = this.cateringAbnormalGroupList;
if(arr.length){ if(arr.length){
// arr = arr.map(x => (x.date = moment(x.date).format('MM-DD'))) // arr = arr.map(x => (x.date = moment(x.date).format('MM/DD')))
arr.sort((a, b) => a.statisticalDate.localeCompare(b.statisticalDate)); arr.sort((a, b) => a.statisticalDate.localeCompare(b.statisticalDate));
this.cateringAbnormalGroupList_ = arr.filter( this.cateringAbnormalGroupList_ = arr.filter(
(x) => (x) =>
...@@ -1945,7 +1945,7 @@ export default { ...@@ -1945,7 +1945,7 @@ export default {
); );
let str = ""; let str = "";
arr.forEach((x) => { arr.forEach((x) => {
let date = moment(x.date).format("M.D"); let date = moment(x.statisticalDate).format("M.D");
str = str + date + ","; str = str + date + ",";
}); });
str = str.substring(0, str.length - 1); str = str.substring(0, str.length - 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment