[Vuejs]-VueJS โ€“ array with Edm.DateTime Elements, transform dates and show them in table

0๐Ÿ‘

โœ…

  convertDate1 (value) {
    if (value === 'null') {
      return value.replace('null', 'no date specified')
    } else {
      var d = new Date(parseInt(value.replace('/Date(', '').replace(')/', ''), 10))
    }
    var month = d.getUTCMonth() + 1  // months from 1-12
    var day = d.getUTCDate()
    var year = d.getUTCFullYear()
    return year + '/' + month + '/' + day
  }

+

<td>{{ convertDate1(value.key) }}</td>

Leave a comment