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

Agenda loadItemsForMonth calls two time and gives wrong date

Open ManishAhire opened this issue 5 years ago • 29 comments

Description

Following are the issues in my app :-

  1. First time loadItemsForMonth calls twice.
  2. On scroll month loadItemsForMonth gives wrong date.
  3. On press date, loadItemsForMonth method call.

Expected Behavior

  1. First time loadItemsForMonth call only one time and it should return the exact date.
  2. On scroll month loadItemsForMonth return exact the date of visible month.
  3. On press date, calls only onDayPress not loadItemsForMonth.

My Code

<Agenda
        items={this.state.items}
        loadItemsForMonth={day => this.loadMonthData(day)}
        onDayPress={day => this.onDatePress(day)}
        renderItem={this.renderItem.bind(this)}
        renderEmptyDate={this.renderEmptyDate.bind(this)}
        rowHasChanged={this.rowHasChanged.bind(this)}
        refreshing={false}
        
/>

loadMonthData(day) {
    console.log("Month date :- ", day);
}

onDatePress(day) {
    console.log("On date press :- ", day);
}

ManishAhire avatar Mar 15 '19 11:03 ManishAhire

any solution?

jhonatansaman avatar Apr 07 '19 17:04 jhonatansaman

+1

dophlin avatar Apr 12 '19 18:04 dophlin

+1 any solution?

elisson avatar May 24 '19 20:05 elisson

+1

foxfl avatar May 26 '19 11:05 foxfl

+1

Plaoo avatar May 30 '19 16:05 Plaoo

same issue

fthkrtl avatar Jul 13 '19 22:07 fthkrtl

Happens to me too. Exactly as described It seems to skip back exactly 60 days

ConnectedReasoning avatar Jul 19 '19 21:07 ConnectedReasoning

+1

GladeyMs avatar Aug 06 '19 07:08 GladeyMs

did anyone manage to solve this?

MrFaisal100 avatar Aug 27 '19 09:08 MrFaisal100

+1

lironsher avatar Sep 13 '19 04:09 lironsher

+1

onisaint avatar Feb 12 '20 10:02 onisaint

Same issue.

kalebjdavenport avatar Apr 22 '20 01:04 kalebjdavenport

So...I tried to debug the error myself. I don't like messing in module code for risk it will break on updates, and I don't understand the issue well enough to send a pull request, but when I add the prop

onVisibleMonthsChange={months => {
       console.log('now these months are visible', months);
}}

it shows that an additional month is being added the the "months" array. Then the onViewableItemsChanged is being called for some reason and setting the component state to months[0]. I changed the function to select months[1] and it appears to work well enough for now. I don't know why this is happening, but if someone on the core team is going to fix the issue, I hope this will be a lead!

kalebjdavenport avatar Apr 24 '20 00:04 kalebjdavenport

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 Aug 22 '20 19:08 stale[bot]

Any solution??

rojeda24 avatar Sep 14 '20 05:09 rojeda24

Any solution to this ?

FadiAboMsalam avatar Nov 18 '20 18:11 FadiAboMsalam

still no solution?

Arslan106 avatar Dec 21 '20 07:12 Arslan106

Yep same issue for me

meliodev avatar Feb 07 '21 20:02 meliodev

Any news on the case?

hnrazevedo avatar Apr 01 '21 23:04 hnrazevedo

same problem here, any news?

ViniciusGularte avatar Apr 16 '21 18:04 ViniciusGularte

Same here!

wilav-dev avatar Jun 23 '21 20:06 wilav-dev

Also same here...

johnpanos avatar Jun 24 '21 05:06 johnpanos

Same!

nickdalts avatar Aug 18 '21 12:08 nickdalts

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 Nov 16 '21 12:11 stale[bot]

I have the same problem here!

JosiasBatista avatar Dec 04 '21 21:12 JosiasBatista

Same !

merouan95 avatar Mar 01 '22 09:03 merouan95

I have the same problem!

albionaberisha avatar May 01 '22 15:05 albionaberisha

Another month, another person with this issue. How has everyone else worked around this?

ekrebs avatar Jun 01 '22 17:06 ekrebs

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 Sep 04 '22 17:09 stale[bot]

Anyone?

insidewill avatar Jun 08 '23 19:06 insidewill