# react-native-datetimepicker-pro

> A customizable calendar, time & month picker for React Native (including Persian Jalaali calendar & locale)

Latest version **1.0.4** (published 2022-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-datetimepicker-pro
pnpm add react-native-datetimepicker-pro
yarn add react-native-datetimepicker-pro
bun add react-native-datetimepicker-pro
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-06-29 |
| First published | 2022-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 48 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Hossein Assefi |
| Maintainers | h_assefi |
| Keywords | react, react-native, react-native-datepicker, datepicker, calendar, react-native-calendar, react-native-calendars, react-native-datetime, react-native-datetimepicker, react-native-persian-calendar, react-native-jalaali-calendar, react-native-datetime-calendar, time-picker, react-native-time-picker, month-picker, react-native-month-picker, persian, jalaali, react-native-jalaali, persian-calendar, customizable-datepicker, datetimepicker |

## Links

- npm: https://www.npmjs.com/package/react-native-datetimepicker-pro
- Repository: https://github.com/h-assefi/react-native-datetimepicker-pro
- Homepage: https://github.com/h-assefi/react-native-datetimepicker-pro#readme
- Issues: https://github.com/h-assefi/react-native-datetimepicker-pro/issues
- npm.io page: https://npm.io/package/react-native-datetimepicker-pro

## Dependencies (2)

- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [moment-jalaali](https://npm.io/package/moment-jalaali.md) ^0.9.2

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2022-06-29
- 1.0.3 — 2022-05-18
- 1.0.2 — 2022-05-18
- 1.0.1 — 2022-05-18
- 1.0.0 — 2022-05-18

## README

# React Native DateTimePicker Pro 📆

A customizable calendar, time & month picker for React Native (including Persian Jalaali calendar & locale). For more information and documentation, please visit [website](https://h-assefi.github.io/react-native-datetimepicker-pro)

## Installation

**npm package users**

> npm i react-native-datetimepicker-pro

**yarn package users**

> yarn add react-native-datetimepicker-pro

![Screenshot_1652875688](https://user-images.githubusercontent.com/43260748/169036251-cc252cc0-b8c3-4b87-be33-06425f9ca939.png)

![Screenshot_1652875715](https://user-images.githubusercontent.com/43260748/169036280-762b40b5-aa94-4382-a0cb-431aaf6dc5db.png)

![Screenshot_1652875701](https://user-images.githubusercontent.com/43260748/169036295-c9c0a9de-b344-4179-a4d1-279d4901d7ef.png)

## Examples

**Basic example**

```
import React, { useState } from 'react';
import DatePicker from 'react-native-datetimepicker-pro';

const BasicUsage = () => {
  const [selectedDate, setSelectedDate] = useState('');

  return (
    <DatePicker
      onSelectedChange={date => setSelectedDate(date)}
    />
  );
};
```

**Jalali Calendar**

```
import React from 'react';
import DatePicker, { getFormatedDate } from 'react-native-datetimepicker-pro';

const JalaliExample = () => {
  return (
    <DatePicker
      isGregorian={false}
      options={{
        defaultFont: 'Shabnam-Light',
        headerFont: 'Shabnam-Medium',
      }}
      selected={getFormatedDate(new Date(), 'jYYYY/jMM/jDD')}
    />
  );
};
```

## API

### Props

| Prop             | Type   | Optional      | Default | Description                                                                                                                   |
| ---------------- | ------ | ------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| isGregorian      | bool   | Yes           | true    | Gregorian calendar is the default. if shamsi is required set this prop to false.                                              |
| selected         | string | Yes           | null    | for gregorian the format should be 'YYYY-MM-DD' and for shamsi 'jYYYY/jMM/jDD'                                                |
| onSelectedChange | func   | No (required) |         | Selected date is returned as a parameter to the function.                                                                     |
| options          | props  | Yes           |         | Some visual effects like font and colors are asigned threw this prop. Check the options prop description table for more info. |

### Options Props

| Prop               | Type   | Optional | Default                   | Description                    |
| ------------------ | ------ | -------- | ------------------------- | ------------------------------ |
| defaultFont        | string | Yes      | 'System'                  | font of dates and times.       |
| headerFont         | string | Yes      | 'System'                  | font of the headers            |
| textFontSize       | int    | Yes      | 15                        |
| textHeaderFontSize | int    | Yes      | 17                        |
| mainColor          | string | Yes      | #61dafb                   | any color format is supported. |
| backgroundColor    | string | Yes      | #fff                      | any color format is supported. |
| textHeaderColor    | string | Yes      | #212c35                   | any color format is supported. |
| textDefaultColor   | string | Yes      | #2d4150                   | any color format is supported. |
| selectedTextColor  | string | Yes      | #2d4150                   | any color format is supported. |
| textSecondaryColor | string | Yes      | #7a92a5                   | any color format is supported. |
| borderColor        | string | Yes      | #rgba(122, 146, 165, 0.1) | any color format is supported. |

---
_Source: https://npm.io/package/react-native-datetimepicker-pro · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
