Make Datepicker to format using fixed/default timezone (dayjs.utc().format()).
We are using the datepicker and we have users from both Europe and Brazil. Even though we use UTC to string dates in order to keep it same for everyone the datepicker always formats it to the locale of the user. This is an issue as we need to keep the same day for everyone. For example a user in Europe will see 31/03/2023 and the user from Brasil will see 30/03/2023.
Is it possible to use a fixed/default timezone? as i see its formating using dayjs that means its formating the date based on locale of users machine. For example dayjs.utc().format(
Hi, I was facing a similar issue as I was initializing the datepicker with dates I already had and was displaying the wrong dates, what worked for me was instead of initializing endDate and startDate with mydate value I just used dayjs().format(mydate.toISOString()) and that seemed to solve the utc issues I was having.
This won't work for all needs. And it might be super wrong, but I solved my issue by removing the time since I only needed the year, month, and day. I hope it helps.
const publishedDate = post.publishedDate; // from db "2023-09-01T00:00:00.000Z"
const startDate = publishedDate.split("T")[0] // "2023-09-01"
Hi, @sikelos13 , Sorry for the late reply.
Please use the new version. For the display format you can use the displayFormat property. Find out more (displayFormat). But in the code we expose only one format for which you are responsible.