react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

Agenda: Automatically jump to previous month when its the 1st day of the month.

Open hughyyyy opened this issue 1 year ago • 3 comments

It's simple: the calendar jumps to the previous month when the first date is selected.

For example: <Agenda ... selected={'2024-07-01'} />

Expected Behavior Calendar doesn't jump to previous month.

Environment "react-native-calendars": "^1.1304.1", "react": "18.2.0", "react-native": "0.73.6",

hughyyyy avatar Jul 01 '24 06:07 hughyyyy

is there any update on this?

yasiragi avatar Jul 22 '24 14:07 yasiragi

Your local timezone produses this issue, for example date 2025-02-28T23:00:00+05:00 means 2025-03-01 on you locale. I found a kind of workaraund on it, not ideal but now my calendar works as expected. I set midday time when change calendar month or day, something like this:

export const setMiddayTime = (date: string | Date) => {
  return moment(date)
    .set("hour", 13)
    .set("minute", 0)
    .set("second", 0)
    .format();
};

pavelpashkovsky avatar Jan 17 '25 08:01 pavelpashkovsky

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 25 '25 00:04 stale[bot]