1.2.1 • Published 6 years ago

react-relative-date-input v1.2.1

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

React relative date input

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

Example

Example for react relative date input

Try it here: https://codesandbox.io/s/jzpr5j2n99

Installation

yarn add react-relative-date-input

Usage

import RelativeDatePicker from "react-relative-date-input";

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

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

Props

Prop nameDescriptionExample values
onChangeFunction that is called if the number or period type is changed(momentDate) => {console.log(momentDate)};
numberInputClassNameCSS classes for number input field"form-control"
numberInputStyleObject with styles for number input field{ fontSize: "14px" }
wrapperClassNameCSS Classes for number input field"col-md-12"
wrapperStyleObject with styles for wrapper{ padding: "5px" }
labelClassNameCSS classes for label"label-class"
labelStyleObject with styles for label{ fontSize: "14px" }
selectClassNameCSS classes period type select field"form-control"
selectStyleObject with styles for period type select field{ fontSize: "14px" }
labelTextText for label"Relative date"
monthsLabelText for months in select"Months"
daysLabelText for days in select"Days"
weeksLabelText for weeks in select"Weeks"
yearsLabelText for years in select"Years"

Build

npx webpack --config webpack.config.js
1.2.1

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago