
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-calenderpicker
Advanced tools
[](https://badge.fury.io/js/react-native-calendarpicker) [](https://github.com/pr
A flexible and customizable React Native calendar picker component that supports both iOS and Android. This component allows single-date selection and date-range selection modes and is compatible with date-fns and moment libraries for seamless date manipulation.
This project requires NodeJS (version 8 or later) and NPM.
Node and NPM are really easy to install.
To make sure you have them available on your machine, try running the following command.
$ npm install date-fns moment react-native-calendarpicker
$ yarn add date-fns moment react-native-calendarpicker
import React, { useState } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import CalendarPicker from 'react-native-calendarpicker';
const App = () => {
const [selectedDates, setSelectedDates] = useState({});
const handleDateChange = (dates) => {
setSelectedDates(dates);
};
return (
<View style={styles.container}>
<Text style={styles.title}>Select a Date or Date Range</Text>
<CalendarPicker
mode="range" // or "single"
StartDate={null}
EndDate={null}
onChange={handleDateChange}
height={40} // Adjust day cell vertical margin
/>
<Text style={styles.output}>
Selected Start Date: {selectedDates?.startDate?.format('DD/MM/YYYY') || 'N/A'}
</Text>
<Text style={styles.output}>
Selected End Date: {selectedDates?.endDate?.format('DD/MM/YYYY') || 'N/A'}
</Text>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 16,
justifyContent: 'center',
},
title: {
fontSize: 20,
fontWeight: 'bold',
marginBottom: 16,
},
output: {
marginTop: 8,
fontSize: 16,
},
});
export default App;
| Prop | Type | Default | Description |
|---|---|---|---|
| onChange | function | null | Callback function invoked when a date or range is selected. |
| mode | string | "single" | Mode of selection. Options: "single" or "range". |
| StartDate | string | null | The initial start date in YYYY-MM-DD format. |
| EndDate | string | null | The initial end date (for range mode) in YYYY-MM-DD format. |
| preview | boolean | false | Enables a preview mode for displaying the selected dates. |
| height | number | 15 | Adjusts the vertical margin of day cells. |
This component requires date-fns and moment for date handling. Make sure to install them using the commands provided above.
You can modify styles such as startDate, endDate, and inRange in the StyleSheet object to customize the UI.
Future dates are automatically disabled and styled with a gray text color.
Month navigation buttons (next and previous) are included.
Feel free to submit issues, feature requests, or pull requests. Feedback and contributions are always welcome to improve the library!
This project is licensed under the MIT License.
Enjoy using the CalendarPicker component for all your React Native calendar needs! 😊
FAQs
[](https://badge.fury.io/js/react-native-calendarpicker) [](https://github.com/pr
We found that react-native-calenderpicker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.