Translate months and days of the week from in Nuxt.js 3 with composition api

I’m using from element plus and I would like to translate the months and days of the week to pt-br. I’m using nuxt 3 with composition api and dayjs.
From what I saw, it should work automatically after configuring dayjs, but it didn’t work. can anybody help me?
Follow the code:

<template>
...
<el-form-item label="Data Inclusão" prop="date_inclusao">
    <el-date-picker v-model="usuario.DATA_EXCLUSAO" type="date" label="Data Inclusão" placeholder="Escolha uma data" format="DD/MM/YYYY" :disabled-date="disabledDate">
    </el-date-picker>
</el-form-item>
...
</template>

<script lang='ts' setup>`
...
import dayjs from 'dayjs';
import 'dayjs/locale/pt-br';
dayjs.locale('pt-br')
...
</script>

`

I tried several other ways without success. I expected it to work with dayjs, as the documentation advises.

Leave a Comment