# react-relative-date-input

> Completely customizable input and select for choosing an relative date in the future.

Latest version **1.2.1** (published 2018-06-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-relative-date-input
pnpm add react-relative-date-input
yarn add react-relative-date-input
bun add react-relative-date-input
```

## 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.2.1 |
| Published | 2018-06-12 |
| First published | 2018-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 47.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sven Schannak |
| Maintainers | svschannak |
| Keywords | react, date |

## Links

- npm: https://www.npmjs.com/package/react-relative-date-input
- Repository: https://github.com/svschannak/react-relative-date-input
- Homepage: https://github.com/svschannak/react-relative-date-input#readme
- Issues: https://github.com/svschannak/react-relative-date-input/issues
- npm.io page: https://npm.io/package/react-relative-date-input

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^16.4.0
- [date-fns](https://npm.io/package/date-fns.md) ^1.29.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2018-06-12
- 1.1.9 — 2018-06-06
- 1.1.8 — 2018-06-06
- 1.1.7 — 2018-06-06
- 1.1.6 — 2018-06-06
- 1.1.5 — 2018-06-06
- 1.1.4 — 2018-06-06
- 1.1.3 — 2018-06-06
- 1.1.2 — 2018-06-06
- 1.1.1 — 2018-06-06
- 1.1.0 — 2018-06-06

## README

# React relative date input

Completely customizable input and select for choosing an relative date in the future.

## Example
![Example for react relative date input](example.png "Example for react relative date input")

**Try it here**: <https://codesandbox.io/s/jzpr5j2n99>

## Installation

```bash
yarn add react-relative-date-input
```

## Usage
```js
import RelativeDatePicker from "react-relative-date-input";

const onChange = (chosenDate) => {
    console.log(chosenDate);
}

const YourForm = () => {
    return (
        <RelativeDatePicker
            onChange={onChange}
        />
    )
}

```

## Props

|Prop name|Description|Example values|
|----|----|----|
|onChange|Function that is called if the number or period type is changed|(momentDate) => {console.log(momentDate)};|
|numberInputClassName|CSS classes for number input field|"form-control"|
|numberInputStyle|Object with styles for number input field|{ fontSize: "14px" }|
|wrapperClassName|CSS Classes for number input field|"col-md-12"|
|wrapperStyle|Object with styles for wrapper|{ padding: "5px" }|
|labelClassName|CSS classes for label|"label-class"|
|labelStyle|Object with styles for label|{ fontSize: "14px" }|
|selectClassName|CSS classes period type select field|"form-control"|
|selectStyle|Object with styles for period type select field|{ fontSize: "14px" }|
|labelText|Text for label|"Relative date"|
|monthsLabel|Text for months in select|"Months"|
|daysLabel|Text for days in select|"Days"|
|weeksLabel|Text for weeks in select|"Weeks"|
|yearsLabel|Text for years in select|"Years"|

## Build
```bash
npx webpack --config webpack.config.js
```

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