rn-calendar-simple
v1.0.8
Published
React Native Calendar
Downloads
199
Readme
react-native-calendar
Installation
yarn add rn-calendar-simple
npm install rn-calendar-simple
How use
import { useState } from 'react';
import { Text, View } from 'react-native';
import { Calendar } from 'rn-calendar-simple';
export default function App() {
const [selectedDate, setSelectedDate] = useState<Date>(new Date());
return (
<View>
<Text>{selectedDate.toLocaleString()}</Text>
<Calendar value={selectedDate} onChange={setSelectedDate} />
</View>
);
}
Props
| Prop | Type | Description | | ------------------------- | ----------------- | ---------------------------------------------- | | value (optional) | Date | The calendar value. | | onChange (optional) | (d: Date) => void | The method called when an update is performed. | | min (optional) | Date | The minimum date to be selected. | | max (optional) | Date | The maximum date to be selected. | | monthLabel (optional) | Array | The name of the months. | | weekLabel (optional) | Array | The name of the weeks. |