1.0.7 ā€¢ Published 9 months ago

react-native_horizontal_calender v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Ā 

:dart: About

React native component which renders list of dates.

:dart: Demo

:dart: Installation

npm i react-native_horizontal_calender

:dart: Example

function App(): JSX.Element {
 
  const [receivedDate, setReceivedDate] = useState<Date>(currentDate);

  const handleDataFromCalender = (date:Date) => {
    console.log('date',date)
    setReceivedDate(date);
  };

  return (
    <View>
      <HorizontalCalender
        onPressed={handleDataFromCalender}
        populateDatesOnLastDateSelect={true}
        userSelectedDate={currentDate}
        startingDate={currentDate}
        numberOfDays={10}
      />
      <Text style={styles.sectionDescription}>{receivedDate.toISOString() }</Text>
    </View>
  );
}

:dart: Platform Support

Supports both Android and iOS.

:dart: Props

PropTypeOptionalDefaultDescription
userSelectedDateDateNon/aUser current date or selected date
onPressed(date: Date) => voidNon/acallback which provides selected date as an argument.
startingDateDateNon/aStarting point of the calender
numberOfDaysnumberYes10Number of days you want to populate
populateDatesOnLastDateSelectbooleanYestrueUse this value if you want to populate dates further on last date select
horizontalbooleanYestrueShow calender horizontal or not