Skip to content

Commit aa2394b

Browse files
Merge branch 'master' into pr/3709
2 parents f12f420 + 60d95bb commit aa2394b

27 files changed

+2700
-1759
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Start reading our code, and you'll get the hang of it. We optimize for readabili
2424

2525
Local development configuration is pretty snappy. Here's how to get set up:
2626

27-
1. Install/use node >=11.10.1
27+
1. Install/use node >=16.0.0
2828
1. Run `yarn link` from project root
2929
1. Run `cd docs-site && yarn link react-datepicker`
3030
1. Run `yarn install` from project root

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
[![Test suite](https://github.com/Hacker0x01/react-datepicker/actions/workflows/test.yml/badge.svg)](https://github.com/Hacker0x01/react-datepicker/actions/workflows/test.yml)
55
[![codecov](https://codecov.io/gh/Hacker0x01/react-datepicker/branch/master/graph/badge.svg)](https://codecov.io/gh/Hacker0x01/react-datepicker)
66
[![Downloads](https://img.shields.io/npm/dm/react-datepicker.svg)](https://npmjs.org/package/react-datepicker)
7-
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/Hacker0x01/react-datepicker.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Hacker0x01/react-datepicker/context:javascript)
8-
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/Hacker0x01/react-datepicker.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Hacker0x01/react-datepicker/alerts)
97

108
A simple and reusable Datepicker component for React ([Demo](https://reactdatepicker.com/))
119

@@ -39,7 +37,7 @@ import "react-datepicker/dist/react-datepicker.css";
3937
const Example = () => {
4038
const [startDate, setStartDate] = useState(new Date());
4139
return (
42-
<DatePicker selected={startDate} onChange={(date:Date) => setStartDate(date)} />
40+
<DatePicker selected={startDate} onChange={(date) => setStartDate(date)} />
4341
);
4442
};
4543
```
@@ -170,4 +168,4 @@ The examples are hosted within the docs folder and are ran in the simple app tha
170168

171169
## License
172170

173-
Copyright (c) 2014-2021 HackerOne Inc. and individual contributors. Licensed under MIT license, see [LICENSE](LICENSE) for the full license.
171+
Copyright (c) 2014-2023 HackerOne Inc. and individual contributors. Licensed under MIT license, see [LICENSE](LICENSE) for the full license.

docs-site/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"highlight.js": "^11.5.1",
7-
"react": "^18.1.0",
6+
"highlight.js": "^11.7.0",
7+
"react": "^18.2.0",
88
"react-app-rewired": "^2.2.1",
9-
"react-dom": "^18.1.0",
9+
"react-dom": "^18.2.0",
1010
"react-live": "^2.4.1",
1111
"react-scripts": "4.0.3"
1212
},
@@ -32,7 +32,7 @@
3232
]
3333
},
3434
"devDependencies": {
35-
"sass": "^1.52.2",
35+
"sass": "^1.57.1",
3636
"raw-loader": "^4.0.2"
3737
}
3838
}

docs-site/src/components/Examples/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ import LocaleWithTime from "../../examples/localeWithTime";
2929
import LocaleWithoutGlobalVariable from "../../examples/localeWithoutGlobalVariable";
3030
import ExcludeDates from "../../examples/excludeDates";
3131
import ExcludeDateIntervals from "../../examples/excludeDateIntervals";
32+
import ExcludeDatesMonthPicker from "../../examples/excludeDatesMonthPicker";
3233
import HighlightDates from "../../examples/highlightDates";
3334
import HighlightDatesRanges from "../../examples/highlightDatesRanges";
3435
import IncludeDates from "../../examples/includeDates";
3536
import IncludeDateIntervals from "../../examples/includeDateIntervals";
37+
import IncludeDatesMonthPicker from "../../examples/includeDatesMonthPicker";
3638
import FilterDates from "../../examples/filterDates";
3739
import DateRange from "../../examples/dateRange";
3840
import DateRangeInputWithClearButton from "../../examples/dateRangeInputWithClearButton";
@@ -87,6 +89,7 @@ import CloseOnScrollCallback from "../../examples/closeOnScrollCallback";
8789
import SelectsRange from "../../examples/selectsRange";
8890
import selectsRangeWithDisabledDates from "../../examples/selectsRangeWithDisabledDates";
8991
import CalendarStartDay from "../../examples/calendarStartDay";
92+
import ExternalForm from "../../examples/externalForm";
9093

9194
import "./style.scss";
9295
import "react-datepicker/dist/react-datepicker.css";
@@ -230,6 +233,10 @@ export default class exampleComponents extends React.Component {
230233
title: "Exclude date intervals",
231234
component: ExcludeDateIntervals,
232235
},
236+
{
237+
title: "Exclude Months in Month Picker",
238+
component: ExcludeDatesMonthPicker,
239+
},
233240
{
234241
title: "Exclude Times",
235242
component: ExcludeTimes,
@@ -266,6 +273,10 @@ export default class exampleComponents extends React.Component {
266273
title: "Include date intervals",
267274
component: IncludeDateIntervals,
268275
},
276+
{
277+
title: "Include Months in Month Picker",
278+
component: IncludeDatesMonthPicker,
279+
},
269280
{
270281
title: "Include Times",
271282
component: IncludeTimes,
@@ -446,6 +457,10 @@ export default class exampleComponents extends React.Component {
446457
title: "Calendar Start day",
447458
component: CalendarStartDay,
448459
},
460+
{
461+
title: "External Form",
462+
component: ExternalForm,
463+
},
449464
];
450465

451466
handleAnchorClick = (e, id) => {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
() => {
2+
const [startDate, setStartDate] = useState(1659312000000);
3+
return (
4+
<DatePicker
5+
selected={startDate}
6+
onChange={(date) => setStartDate(date)}
7+
dateFormat="MM/yyyy"
8+
excludeDates={[
9+
1661990400000, 1664582400000, 1667260800000, 1672531200000,
10+
]}
11+
showMonthYearPicker
12+
/>
13+
);
14+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
() => {
2+
const [startDate, setStartDate] = useState(null);
3+
4+
return (
5+
<>
6+
<DatePicker
7+
selected={startDate}
8+
onChange={(date) => setStartDate(date)}
9+
required
10+
form="external-form"
11+
/>
12+
<form id="external-form">
13+
<input type="submit" />
14+
</form>
15+
</>
16+
);
17+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
() => {
2+
const [startDate, setStartDate] = useState(1661990400000);
3+
return (
4+
<DatePicker
5+
selected={startDate}
6+
onChange={(date) => setStartDate(date)}
7+
dateFormat="MM/yyyy"
8+
includeDates={[
9+
1661990400000, 1664582400000, 1667260800000, 1672531200000,
10+
]}
11+
showMonthYearPicker
12+
/>
13+
);
14+
};

0 commit comments

Comments
 (0)