Logo Lanfrica

leulseged3/react-native-ethiopian-calendar

Record type:

software
Creator:
leu
Host:
React Native Ethiopian Calendar Component # React Native Ethiopian Calendar A react native calendar component which is mainly intended for applications which require Ethiopian calendar. ## Features - Ethiopian/Gregorian mode toggle - Supports multiple local languages - Easy to customize - Zero dependency - Fully typed with typescript ## Demo ## Installation with yarn ```bash yarn add react-native-ethiopian-calendar ``` Install with npm ```bash npm i react-native-ethiopian-calendar ``` ## Usage/Examples #### Typescript Example ```javascript import { Calendar, LanguageCode, Mode, SelectedDate, } from 'react-native-ethiopian-calendar'; function App() { const [mode, setMode] = React.useState ('EC'); const [locale, setLocale] = React.useState ('AMH'); const [selectedDate, setSelectedDate] = React.useState (); return ( setSelectedDate(date)} onModeChange={(selectedMode) => setMode(selectedMode)} onLanguageChange={(lang) => setLocale(lang)} locale={locale} /> ) } ``` #### Javascript Example ```javascript import { Calendar } from 'react-native-ethiopian-calendar'; function App() { const [mode, setMode] = React.useState('EC'); const [locale, setLocale] = React.useState('AMH'); const [selectedDate, setSelectedDate] = React.useState(); return ( setSelectedDate(date)} onModeChange={(selectedMode) => setMode(selectedMode)} onLanguageChange={(lang) => setLocale(lang)} locale={locale} /> ); } ``` ## API Reference | Prop | Type | Required | Description | Default | | :------------------ | :-------------- | :------- | :------------------------------------------------------------------- | :-------------------------- | | `mode` | `Mode` | `false` | a prop to switch b/n Ethiopian calendar and Gregorian calendar | `EC` | | `locale` | `LanguageCode` | `false` | to change the language of days names and months names. | `AMH for EC …