React-native-calendars: Get Month on Scroll

Created on 19 Apr 2018  路  5Comments  路  Source: wix/react-native-calendars

I am using this code... I just want to know if we can use onScroll method to get the current visible month?

<Agenda
    items={{
        '2018-04-18': [{text: 'item 1 - any js object'}],
        '2018-04-19': [{text: 'item 2 - any js object'}],
        '2018-04-20': [],
        '2018-04-21': [{text: 'item 3 - any js object'},{text: 'any js object'}],
    }}
    renderItem={this.renderItem.bind(this)}
    renderEmptyDate={this.renderEmptyDate.bind(this)}
    rowHasChanged={(r1, r2) => {return r1.text !== r2.text}}
/>
Question stale

All 5 comments

This is something I am wondering about as well. I love this library and was able to get up and running pretty quickly. Here is what my current calendar implementation looks like:

screen shot 2018-04-24 at 2 28 00 pm

and I am using the <CalendarList /> component with horizontal and pagingEnabled props.

Hence in my use case (see screenshot above), I would like to display a unique monthly summary for every month. Hence on scroll I need a callback which returns a month string.

Is this currently possible? I cound't find anything on the docs, but please let me know if I missed something.

I'm using loadItemsForMonth callback for this but it is triggered twice. For the first time the result is correct. But on the second i get previous month. Looking for solution.

I'm using loadItemsForMonth callback for this but it is triggered twice. For the first time the result is correct. But on the second i get previous month. Looking for solution.

Same issue

Any solution..

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sonnguyenit picture sonnguyenit  路  3Comments

joaosauer picture joaosauer  路  4Comments

sommeshEwall picture sommeshEwall  路  3Comments

idlework picture idlework  路  4Comments

matieux picture matieux  路  4Comments