1.0.8 • Published 2 years ago
rn-calendar-simple v1.0.8
react-native-calendar
Installation
yarn add rn-calendar-simplenpm install rn-calendar-simpleHow 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. |