从后端获取的数据时是这样的:

{
  "TotalCount":14,"Items":
  [
    {
      "ProfileId":14,
      "Name":"网站分析-测试3",
      "LastModifyTime":"2017-07-26T10:59:45.5433333",
      "PlanId":3733310,"BatchId":53,
        }
    ]
}            

想改变“时间的显示格式”和“为数字加上千位符号”,代码如下:

              self.$scope.gridOptions.data = [];
              self.analyzeService.getAnalyzeProfile(self.$scope.gridDataOption, self.$scope.onlyMine).then(function (res) {
                  let datas = res.Items;
                  self.$scope.gridOptions.data = _.map(datas, item => {
                      item.CrawlCountShow = item.CrawlCount.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' +  ',')
                      item.LastModifyTime = self.formatDate(new Date(item.LastModifyTime));
                      return item;
                  });
             });

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案