Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gives one day before value in text and distorted preselect ui colour #111

Open
Aakash007-ai opened this issue Sep 12, 2024 · 4 comments
Open

Comments

@Aakash007-ai
Copy link

Hi you can check this bug by running example too.
It is some kind of weired , if you select any date it got selected correct but in state value , it is one day before and if you try to convert that state to string date format. (to Mon , 2 ,2024, february), it gives you correct selected data but it will be 01-02-2024T
so it gives correct date when you select , but actual state value we got is one day before, it is apllicable for range too ,
please correct this.

also if we call that DatePicker with preselectd date range it gives a broken range's color in between the strip

@snursultan
Copy link

Hello @Aakash007-ai

I had the same problem. Fixed by wrapping the date that you are getting from the picker in the dayjs constructor and then using toDate method like this:

<DateTimePicker
        mode="single"
        date={date}
        onChange={(params) => console.log(dayjs(params.date).toDate())}
      />

Don't forget to import dayjs like this: import dayjs from 'dayjs'

Hope it helps!

@snursultan
Copy link

@Aakash007-ai Could you also provide the screenshot of broken strip? It would be very helpful.

@GSFZamai
Copy link

GSFZamai commented Sep 26, 2024

Hi there, I'm having the exact same problema but, at least, until now with only two specific dates:
10/11/1998 and 10/25/1992

Seens to be related to this issue #75

After digging into the lib implementation, this problem seens to be retaled to the dayjs lib

@Aakash007-ai
Copy link
Author

hi @snursultan ,
this is the distorted ui i am concerned about
Screenshot_1728884524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants