P粉7207169342023-09-04 09:00:21
I am not very familiar with Laravel and have not used Vue.js. But I think you can also solve this problem using core PHP. I've modified your code as shown below. When I retrieve a date from a MySQL database that I want to format, I use date('format', variable). In your case this would result in my code below. The format can be displayed in a variety of ways, including: 'm/d/y', 'd/m/y', 'y/d/m', etc. Where m represents the month, d represents the day, and of course y represents the year.
As @Uwe pointed out, my suggestion is to embed the php code in the vue.js code. However, since I know you use both php and vue.js, I'm still wondering if my modified solution below will work. Or within that range.
<tr v-for="(curriculumVitae, index) in curriculumVitaes" :key="index"> <td class="text-center">{{ index + 1 }}</td> <td class="text-center">{{ <?php echo date("y/d/m", curriculumVitae.created_at); ?> }}</td> </tr>