Skip to content

emirdeliz/rn-calendar-simple

Repository files navigation

react-native-calendar

Test Lint

Peggada

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.