封装将中国标准时间转化为年月日 时分秒

 //时期选择器的清空按钮
    saveTime(val){
      // this.runEndTimeall =[]
      // this.createEndTimeall = []
     if (val == null) val = []
    this.timeFormatter(Date.parse(val));
    },
    // timeFormatter(time) {
    //   if(time){
    //     const d = new Date(time);
    //     const timeString = `${this.timeFormat(d.getFullYear())}-${this.timeFormat(d.getMonth() + 1)}-${this.timeFormat(d.getDate())}`;
    //     return timeString
    //   }else{
    //     return ''
    //   }
    // },
    // timeFormat(val) {
    //   return val < 10 ? `0${val}` : val;
    // },
发布了67 篇原创文章 · 获赞 22 · 访问量 9414

猜你喜欢

转载自blog.csdn.net/qq_39897978/article/details/104836031
今日推荐