日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

el-table-column 表單table的后端返回時間戳的轉換

作者:農夫三拳有點疼=-= 更新時間: 2023-10-17 編程語言
<el-table-column prop="releaseDate" label="結算時間" align="left" :formatter="dateFormat">
</el-table-column>

方法
dateFormat(row, column,cellValue,index) {
      let date = new Date(parseInt(cellValue));
      if(isNaN(date)) return '--'
      let Y = date.getFullYear() + '-';
      let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) + '-' : date.getMonth() + 1 + '-';
      let D = date.getDate() < 10 ? '0' + date.getDate() + ' ' : date.getDate() + ' ';
    /* let h = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
      let m = date.getMinutes()  < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':';
      let s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();*/
      return Y + M + D ;/*+ h + m + s;*///不要 時分秒
    },

原文鏈接:https://blog.csdn.net/m0_64207574/article/details/130942668

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新