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

Change current visible month #2600

Open
ender-null opened this issue Feb 10, 2025 · 2 comments
Open

Change current visible month #2600

ender-null opened this issue Feb 10, 2025 · 2 comments

Comments

@ender-null
Copy link

ender-null commented Feb 10, 2025

I have a button that changes the current selected date to today, but doesn't change the month to the month of the current selected day.

I am missing something or is not supported?

@Quietly-20201113
Copy link

我有一个按钮,可以将当前选定的日期更改为今天,但不会将月份更改为当前选定日期的月份。

我遗漏了某些东西或者不受支持?

https://stackoverflow.com/questions/77589425/how-can-i-select-the-year-in-react-native-calendars See if it's what you need

@Quietly-20201113
Copy link

I have a button that changes the current selected date to today, but doesn't change the month to the month of the current selected day.

I am missing something or is not supported?

I also encountered this problem, embarrassing, my solution is

<Calendar
        key={currentDate.toString()}
        current={currentDate}
        disableMonthChange={false}
        onDayPress={handleDayPress}
        renderHeader={(date: any) => renderCalendarHeader(date)}
        enableSwipeMonths={true}
        firstDay={1} />

I added a key to it and changed it with current. The problem was solved, but I don't know if there is any performance problem.

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

2 participants