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

selectedDates not working ONLY for a SPECIFIC month 😱 #619

Open
Ale-Digitale opened this issue Jun 28, 2024 · 5 comments
Open

selectedDates not working ONLY for a SPECIFIC month 😱 #619

Ale-Digitale opened this issue Jun 28, 2024 · 5 comments

Comments

@Ale-Digitale
Copy link

Hi there,

I'm using latest version v3.5.3

today is: 2024-06-28 ( 28 June 2024 )

selectedDates DOESN'T WORK for PAST dates and FUTURE dates for the month of JUNE !

Let me gives you examples:

  1. any date in the PAST works PERFECTLY ( EXCEPT June )
    selectedDates: ['2023-05-01'] .... works
    selectedDates: ['2021-12-29'] .... works
    selectedDates: ['2019-10-15'] .... works
    selectedDates: ['2022-06-04'] .... FAILS, it's JUNE !

  2. any date in the FUTURE works PERFECTLY ( EXCEPT June )
    selectedDates: ['2025-05-01'] .... works
    selectedDates: ['2027-12-29'] .... works
    selectedDates: ['2029-10-15'] .... works
    selectedDates: ['2031-06-04'] .... FAILS, it's JUNE !

  3. any date in the CURRENT YEAR works PERFECTLY ( INCLUDING June )
    selectedDates: ['2024-05-01'] .... works
    selectedDates: ['2024-12-29'] .... works
    selectedDates: ['2024-10-15'] .... works
    selectedDates: ['2024-06-04'] .... works

I don't have any strange setting in my AirDatepicker, no maxDate, no minDate, nothing !

When I say it doesn't work, I mean:
the DATE doesn't get SELECTED, the calendar view is set to the current year and month, with no day being selected.

Now, I don't know if this is specifically for JUNE.... or it's affecting the current month, therefore, next month this will happen to JULY and so on...

Please, check ( and fix ) it, thank you !

Alex

@IamRoockie
Copy link

I have the same problem

@t1m0n
Copy link
Owner

t1m0n commented Oct 30, 2024

Hi there! Thanks for the bug report, but I was not able to reproduce it. Heres the working example - https://codesandbox.io/p/sandbox/z5rf82

Maybe you could provide your live code example?

@Ale-Digitale
Copy link
Author

Hi @t1m0n !

Yeah, I confirm that you can reproduce the BUG in your codesandbox too.

the "mistake" that you did in your example, is that you've set it to JUNE: selectedDates: ["2031-06-04"]

but, like I said in my bug report, the BUG happens when you try to use the CURRENT MONTH with selectedDates.

and since today we're in OCTOBER, if you try to pass it any FUTURE or PAST October day, it WON'T WORK ...

@t1m0n
Copy link
Owner

t1m0n commented Oct 31, 2024

Oh, I see. Yeah, there is some confusion about how it should work. As a temporary solution you can define startDate option to show desired date initially.

@t1m0n t1m0n pinned this issue Oct 31, 2024
@t1m0n t1m0n unpinned this issue Oct 31, 2024
@t1m0n
Copy link
Owner

t1m0n commented Oct 31, 2024

Dublicate of #462

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

No branches or pull requests

3 participants