react-native-hijri-date-picker
TypeScript icon, indicating that this package has built-in type declarations

0.3.5 • Public • Published

Hijri Calendar Date Picker for React Native

Installation

npm install react-native-hijri-date-picker

Usage

import * as React from 'react';

import { StyleSheet, Text, View } from 'react-native';
import {
  HijriRNDatePicker,
  type TDate,
} from 'react-native-hijri-date-picker';

export default function App() {
  const [date, setDate] = React.useState<TDate>({
    year: '',
    month: '',
    day: '',
  });

  const updateDate = (params: TDate) => {
    setDate((prevDate) => ({
      ...prevDate,
      ...params,
    }));
  };

  return (
    <View style={styles.container}>
      <HijriRNDatePicker
        updateDate={updateDate}
        numericMonth={false}
        labelLang="en"
        valueLang="ar"
        viewStyle={{ width: 300 }}
      />
      <Text style={styles.label}>{JSON.stringify(date)}</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    width: '100%',
    height: 500,
    backgroundColor: '#f0f0f0',
  },
  label: {
    fontSize: 20,
    marginTop: 20,
  },
});

Screen Recording

iOS + Android

Hijri Date Picker in Action Hijri Date Picker in Action in Android

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Package Sidebar

Install

npm i react-native-hijri-date-picker

Weekly Downloads

211

Version

0.3.5

License

MIT

Unpacked Size

118 kB

Total Files

73

Last publish

Collaborators

  • y471n