I am working on a project where i need to format the date to get the data i need and the date is formatted as 05-July. Below is the code i have to format the date:
function dateFormated() {
return new Date()
.toLocaleDateString("default", { day: "2-digit", month: "short" })
.replace(" ", "-");
}
It shows incorrectly on brave July-05, but on Firefox and edge it shows the correct way i formatted 05-July.
Does anyone know the reason and how i can correct it. Appreciate your time.
I would guess (totally not sure) that Brave doesn’t provide as much information about the user (on purpose), so you don’t get to know if they are in a country that prefers day-month ordering or one that prefers month-day ordering.