How to use the element-ui/src/utils/date.format function in element-ui

To help you get started, we’ve selected a few element-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vipshop / ams / src / utils / date.js View on Github external
let date;
    if (time instanceof Date) {
        date = time;
    } else {
        const intTime = parseInt(time, 10);
        const len = (String(time)).length;
        if (len === 10 && intTime == time) { // eslint-disable-line eqeqeq
            date = new Date(intTime * 1000);
        } else if (len > 10 && len <= 13 && intTime == time) {  // eslint-disable-line eqeqeq
            date = new Date(intTime);
        } else {
            return time;
        }
    }

    return fecha.format(date, cFormat);
}
github ccfish86 / jvue-admin / client / jvue-client / src / common / constants.js View on Github external
onClick (picker) {
        const end = new Date()
        const start = new Date()
        start.setTime(start.getTime() - 3600 * 1000 * 24 * 180)
        picker.$emit('pick', [start, end])
      }
    }, {
      text: '当月' + dateUtil.format(new Date(), 'yyyy-M'),
      onClick (picker) {
        const end = new Date()
        const start = new Date()
        start.setDate(1)
        picker.$emit('pick', [start, end])
      }
    }, {
      text: '前月' + dateUtil.format(new Date().setDate(0), 'yyyy-M'),
      onClick (picker) {
        const end = new Date()
        end.setDate(0)
        const start = new Date()
        start.setDate(1)
        start.setMonth(start.getMonth() - 1, 1)
        picker.$emit('pick', [start, end])
      }
    }, {
      text: '当周',
      onClick (picker) {
        const end = new Date()
        let start = new Date()
        start.setDate(start.getDate() - start.getDay() + 1)
        picker.$emit('pick', [start, end])
      }
github ElemeFE / element / packages / calendar / src / main.vue View on Github external
formatedToday() {
      return fecha.format(this.now, 'yyyy-MM-dd');
    },
github QQhuxuhui / kafkaMonitor / kafkaMonitor-ui / src / components / pages / kafka / operate / Topic.vue View on Github external
formatCreateDate: function (row, column) {
        let date = new Date(row.createDate);
        return dateUtil.format(date, 'yyyy-MM-dd HH:mm:ss');
      },
      deleteTopicMethod(zookeeper, topic) {
github ccfish86 / jvue-admin / client / jvue-client / src / common / utility.js View on Github external
formatDate (date, format) {
    date = utils.toDate(date)
    if (!date) return ''
    return dateUtil.format(date, format || 'yyyy-MM-dd')
  },
  formatDateTime (date, format) {
github ElemeFE / element / packages / calendar / src / date-table.vue View on Github external
curMonthDatePrefix() {
      return fecha.format(this.date, 'yyyy-MM');
    },
github ElemeFE / element / packages / calendar / src / main.vue View on Github external
prevMonthDatePrefix() {
      const temp = new Date(this.date.getTime());
      temp.setDate(0);
      return fecha.format(temp, 'yyyy-MM');
    },
github ElemeFE / element / examples / components / theme / theme-card.vue View on Github external
formatDate(timestamp) {
      if (!timestamp) return '';
      return dateUtil.format(new Date(timestamp), 'yyyy-MM-dd HH:mm');
    },
    uploadClick() {
github ElemeFE / element / packages / calendar / src / date-table.vue View on Github external
prevMonthDatePrefix() {
      const temp = new Date(this.date.getTime());
      temp.setDate(0);
      return fecha.format(temp, 'yyyy-MM');
    },
github ccfish86 / jvue-admin / client / jvue-client / src / common / utility.js View on Github external
formatDateTime (date, format) {
    date = utils.toDate(date)
    if (!date) return ''
    return dateUtil.format(date, format || 'yyyy-MM-dd HH:mm:ss')
  },
  formatSeconds (value) {