1.0.2 • Published 3 years ago

react-native-jalali-ios-style-datepicker v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

# react-native-jalali-ios-style-datepicker

React Native Jalali IOS Style DatePicker component for both Android and iOS, using React Native Reanimated, React Native Gusture Handler

Install

yarn add react-native-redash
yarn add react-native-reanimated@1.8.0
yarn add react-native-gusture-handler
yarn add react-native-jalali-ios-style-datepicker

Demo

IOS

Usage

import DatePicker from "react-native-jalali-ios-style-datepicker";

export default function App() {
  const [isOpen, setIsOpen] = useState(false);
  const [date, setDate] = useState("");

  const confirmDatePicker = (value: string) => setDate(value);
  const closeDatePicker = () => setIsOpen(false);
  const openDatePicker = () => setIsOpen(true);

  return (
    <View style={styles.container}>
      <Text onPress={openDatePicker}>Date : {date}</Text>

      <DatePicker
        isOpen={isOpen}
        close={closeDatePicker}
        callback={confirmDatePicker}
      />
    </View>
  );
}

Properties

PropDefaultTypeDescription
callback-functionThis is called when the user confirm the picked date or time in the UI.
textButtonStyle-TextStyleCreating custom ui for confirm button text
confirmButtonStyle-ViewStyleCreating custom ui for confirm button
titleStyle-TextStyleCreating custom ui for title text
backdropColorrgba(0,0,0,0.5)string
pickerBgColorwhitestring
confirmTextتایید تاریخstring
titleتاریخ مورد نظرتو انتخاب کن!string
isOpen-boolean
close-function