Skip to content

Commit d3c9e47

Browse files
committed
v2
1 parent a6e50cc commit d3c9e47

File tree

9 files changed

+4737
-2650
lines changed

9 files changed

+4737
-2650
lines changed

Diff for: .idea/inspectionProfiles/Project_Default.xml

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: README.md

+25-15
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
11
## react-horizontal-datepicker
2-
A fully style-able horizontal date picker with the option to scroll for web
3-
![Example](https://i.imgur.com/oe3WEGF.jpg)
2+
###### V2 with new logic and completely removing dependancy on react-waypoint as well as leaner code which now uses css-modules
3+
4+
A simple and lightweight easily style-able Side scrolling datepicker, built with ❤️
5+
| | |
6+
:------------------------------------ |:------------------------------------:
7+
![](https://i.imgur.com/2vawdez.jpg) | ![](https://i.imgur.com/3IYCCPJ.jpg)
8+
![](https://i.imgur.com/0aixw6v.jpg) | ![](https://i.imgur.com/M467k3A.jpg)
9+
410

511
### Installation
612

713
Run `yarn add react-horizontal-datepicker`
14+
or
15+
Run `npm i react-horizontal-datepicker`
816

917
### Usage
1018

1119
Import:
1220

1321
`import DatePicker from "react-horizontal-datepicker";`
1422

15-
and use as:
23+
and simply use the component as:
1624

1725
```javascript
18-
<DatePicker/>
26+
<DatePicker />
1927
```
2028

21-
Available Props are
29+
example at the end
30+
31+
#### Available Props are
2232

2333
| Prop | Type | Default | Description |
2434
| ------------- |:-------:| :-------:| ----------- |
25-
| shouldScroll | Boolean | false | Set List to be scrollable |
26-
| getSelectedDay| Function| | Function to get the selected Day |
27-
| endDate | Number | 90 | Number of days to render from current date |
28-
| selectDate | Date | | prop to send selected date manually or from another calendar component |
29-
30-
endDate currently has no effect on non scrolling list
35+
| getSelectedDay | Function | | Function to get the selected Day |
36+
| endDate | Number| 90 | Number of days to render from current date |
37+
| selectDate | Date | | prop to send selected date manually or from another calendar component |
38+
| color | String | 'rgb(54, 105, 238)' | Set the primary color can be any color format in string |
39+
| labelFormat | String | 'MMMM yyyy' | Month label format - uses [date-fns format](https://date-fns.org/v1.30.1/docs/format) types |
3140

32-
Example:
41+
### Example:
3342

3443
```javascript
3544
function App() {
@@ -40,14 +49,15 @@ function App() {
4049

4150
return (
4251
<DatePicker getSelectedDay={selectedDay}
43-
shouldScroll={true}
4452
endDate={100}
45-
selectDate={new Date("2020-01-30")}
53+
selectDate={new Date("2020-04-30")}
54+
labelFormat={"MMMM"}
55+
color={"#374e8c"}
4656
/>
4757
);
4858
}
4959
```
5060

5161
### Todo
52-
Add selectors for starting date and disabled dates
62+
maybe use react window for efficiency
5363

0 commit comments

Comments
 (0)