-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(): set locale pt, pt-br correct weekdays and months (#1697)
- Loading branch information
Showing
2 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e019301
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I start to get this error
{
inicialDate: M {
'$L': 'en',
'$u': undefined,
'$d': 2024-03-02T16:00:28.320Z,
'$y': 2024,
'$M': 2,
'$D': 2,
'$W': 6,
'$H': 13,
'$m': 0,
'$s': 28,
'$ms': 320,
'$x': {},
'$isDayjsObject': true
},
finalDate: M {
'$L': 'en',
'$u': undefined,
'$d': 2024-03-02T16:00:28.320Z,
'$y': 2024,
'$M': 2,
'$D': 2,
'$W': 6,
'$H': 13,
'$m': 0,
'$s': 28,
'$ms': 320,
'$x': {},
'$isDayjsObject': true
}
}
Your locale has not been found.
Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale
Or you forget to import the locale from 'dayjs/locale/{localeUsed}'
fallback on English locale
my config on dayjs.ts, im use NEXTjs 14
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import "dayjs/locale/pt-br";
dayjs.locale("pt-br");
dayjs.extend(utc);