mahdi-picker
v1.0.3
Published
A simple Persian Date Picker
Downloads
1
Readme
React native mahdi picker
A simple Persian Date Picker
android Installation
yarn
yarn add mahdi-picker
yarn add mahdi-wheel
npm
npm install mahdi-picker
npm install mahdi-wheel
ios
npm install @react-native-community/picker
pod install
Usage
import React, { useState } from "react";
import {
Text,
View,
Pressable
} from "react-native";
import DatePicker from 'mahdi-picker'
const App = () => {
const [visible, setVisible] = useState(false);
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<DatePicker
visible={visible}
itemTextColor='rgb(100, 100, 100)' // dont use hex color
selectedItemTextColor='black' // dont use hex color
selectedItemBorderColor='black'
textColor='rgb(0,0,0)'
backgroundColor='#37f507'
mainBackgroundColor='white'
fontFamily='Roboto'
fontSize={16}
future={false}
beforeMaxYear={50}
futureMaxYear={10}
borderRadius={10}
onRequestClose={() => setVisible(false)}
onPressAction={(date) => { setVisible(false) }}
/>
<Pressable onPress={() => setVisible(true)}>
<Text style={{ fontFamily: 'Roboto' }}>Choose date</Text>
</Pressable>
</View>
);
};
export default App;