1

I have this timestamp format in my UI directly from the API/Database.

2022-04-01T09:00 --> 04/01/2022

Is there a way to parse it and rendering in a nicer format with Vue.js ?

I have

<template v-slot:item.start_date="{ item }">
    <v-chip>
        {{ item.start_date }}
    </v-chip>
</template>
code-8
  • 54,650
  • 106
  • 352
  • 604

1 Answers1

2

You could the `` method from the Date object :

<template v-slot:item.start_date="{ item }">
    <v-chip>
        {{new Date(item.start_date).toLocaleDateString() }}
    </v-chip>
</template>
Boussadjra Brahim
  • 82,684
  • 19
  • 144
  • 164