# react-dates-fns

> A responsive and accessible date range picker component built with React

Latest version **20.2.7** (published 2019-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-dates-fns
pnpm add react-dates-fns
yarn add react-dates-fns
bun add react-dates-fns
```

## 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 | 20.2.7 |
| Published | 2019-07-08 |
| First published | 2018-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Maja Wichrowska |
| Maintainers | vnox |

## Links

- npm: https://www.npmjs.com/package/react-dates-fns
- Repository: https://github.com/urobots/react-dates-fns
- Homepage: https://github.com/urobots/react-dates-fns#readme
- Issues: https://github.com/urobots/react-dates-fns/issues
- npm.io page: https://npm.io/package/react-dates-fns

## Dependencies (15)

- [raf](https://npm.io/package/raf.md) ^3.4.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [date-fns](https://npm.io/package/date-fns.md) ^2.0.0-beta.2
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [react-portal](https://npm.io/package/react-portal.md) ^4.2.0
- [object.assign](https://npm.io/package/object.assign.md) ^4.1.0
- [object.values](https://npm.io/package/object.values.md) ^1.1.0
- [is-touch-device](https://npm.io/package/is-touch-device.md) ^1.0.1
- [airbnb-prop-types](https://npm.io/package/airbnb-prop-types.md) ^2.13.2
- [react-with-styles](https://npm.io/package/react-with-styles.md) ^3.2.3
- [consolidated-events](https://npm.io/package/consolidated-events.md) ^1.1.1 || ^2.0.2
- [react-with-direction](https://npm.io/package/react-with-direction.md) ^1.3.0
- [react-outside-click-handler](https://npm.io/package/react-outside-click-handler.md) ^1.2.3
- [react-addons-shallow-compare](https://npm.io/package/react-addons-shallow-compare.md) ^15.6.2
- [react-with-styles-interface-css](https://npm.io/package/react-with-styles-interface-css.md) ^4.0.3

## Recent versions

- 20.2.7 (latest) — 2019-07-08
- 20.2.6 — 2019-07-08
- 20.2.5 — 2019-07-08
- 18.4.2 — 2019-01-28
- 18.4.1 — 2019-01-27
- 18.3.1 — 2019-01-12
- 18.2.2 — 2018-12-11
- 18.1.1 — 2018-10-29
- 1.0.7 — 2018-10-11
- 1.0.6 — 2018-10-11
- 1.0.5 — 2018-10-09
- 1.0.4 — 2018-10-09
- 1.0.3 — 2018-10-09
- 1.0.2 — 2018-10-09
- 1.0.1 — 2018-10-09
- … 1 more at https://npm.io/package/react-dates-fns/versions

## README

# react-dates-fns

> An easily internationalizable, accessible, mobile-friendly datepicker library for the web. (Using date-fns instead of moment)

![react-dates in action](https://raw.githubusercontent.com/airbnb/react-dates/master/react-dates-demo.gif)

For examples of the datepicker in action, go to http://airbnb.io/react-dates.

To use a locale:

Add date-fns supported languages to utils/getLocale.js

```
import enUS from 'date-fns/locale/en-US';
import ptBR from 'date-fns/locale/pt-BR';
import zhCN from 'date-fns/locale/zh-CN';

export default function getLocale(locale) {
  switch (locale) {
    case 'en-US':
      return enUS;
    case 'pt-BR':
      return ptBR;
    case 'zh-CN':
      return zhCN;
    default:
      return enUS;
  }
}
```


Pass the locale to component like this:

```
<DateRangePickerWrapper
    showClearDates
    startDatePlaceholderText="入住日期"
    endDatePlaceholderText="退房日期"
    monthFormat="yyyy[年]MMMM"
    phrases={{
        closeDatePicker: '关闭',
        clearDates: '清除日期',
    }}
    locale="zh-CN"
/>
```

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