jodifo-date-picker
v2.1.4
Published
a library for building an app with date picking
Downloads
17
Readme
DATE PICKER LIBRARY
This is a react library that provides components to work with tasks management
Installation
to install run: yarn add jodifo-date-picker
note that you need have react and react-dom libraries installed in your project
Hot to use
DatePicker
First import DatePicker from library
import { DatePicker } from "jodifo-date-picker";
Then inside of application you need to connect this component to state
const [defaultValue, setDefaultValue] = useState("");
<DatePicker
dateValue={defaultValue}
setDateValue={(newValue) => setDefaultValue(newValue)}
/>
Note, that state should be of type string
RangePicker
First import RangePicker from library
import { RangePicker } from "jodifo-date-picker";
Then inside of application you need to connect this component to state
const [defaultValue, setDefaultValue] = useState(["", ""]);
<RangePicker
dateValue={defaultValue}
setDateValue={(newValue) => setDefaultValue(newValue)}
/>
Note, that state should be of type [string, string]
Additional options
You can also specify other parameters
- maxDate: {year: number, month: number from 0 to 11, day: number}
- minDate: {year: number, month: number from 0 to 11, day: number}
- showWeekends: boolean
- showHolidays: boolean
- startFromMonday: boolean
- weekView: boolean
Testing
- run yarn test-unit to run unit tests
Linting
run yarn lint to lint application
run yarn lint-fix to lint application and fix errors
Building
run yarn build to build application
run yarn build-storybook to build static storybook files
Development
- run yarn storybook to start storybook on local server