Skip to content

Latest commit

 

History

History
90 lines (61 loc) · 3.31 KB

File metadata and controls

90 lines (61 loc) · 3.31 KB
React Native_horizontal_calender

 

React Native Horizontal Calender

Github top language Github language count Repository size License

🎯 About

React native component which renders list of dates.

🎯 Demo


🎯 Installation

npm i react-native_horizontal_calender

🎯 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>
  );
}

🎯 Platform Support

Supports both Android and iOS.

🎯 Props

Prop Type Optional Default Description
userSelectedDate Date No n/a User current date or selected date
onPressed (date: Date) => void No n/a callback which provides selected date as an argument.
startingDate Date No n/a Starting point of the calender
numberOfDays number Yes 10 Number of days you want to populate
populateDatesOnLastDateSelect boolean Yes true Use this value if you want to populate dates further on last date select
horizontal boolean Yes true Show calender horizontal or not