React-native-calendars: Range of days - only two selection

Created on 4 Jan 2020  路  2Comments  路  Source: wix/react-native-calendars

I am trying to create a range of days with the a start day and an end day variable, but i can't find a wiki or any other info explaining how to use this calendar.

Here a example how i want to do:

calendar

I'm using react-native 60.5, with hooks and typescript.

this is my code:

          <Calendar
            markingType={'period'}
            hideExtraDays={true}
            style={{
              height: 350,
              width: '86%',
            }}
            onDayPress={(day) => {
              setActive_id(null);
              setOpenStyle(false);
              onDateChange(day);
              setSelectedDay(day.dateString);
            }}
            markedDates={{ [selectedDay]: { selected: true, marked: true, selectedColor: '#148CDB' } }}
          />
Question stale

All 2 comments

@estevanpedro Checkout the 'Period marking' section in the README.

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

AleksandrZhukov picture AleksandrZhukov  路  3Comments

idlework picture idlework  路  4Comments

ercpereda picture ercpereda  路  4Comments

joaosauer picture joaosauer  路  4Comments

matieux picture matieux  路  4Comments