Skip to content

Commit

Permalink
Merge branch 'master' into pr/3799
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnrusschen committed Jan 30, 2023
2 parents 35dd9e2 + 799a06f commit c570302
Show file tree
Hide file tree
Showing 22 changed files with 1,645 additions and 989 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Start reading our code, and you'll get the hang of it. We optimize for readabili

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

1. Install/use node >=11.10.1
1. Install/use node >=16.0.0
1. Run `yarn link` from project root
1. Run `cd docs-site && yarn link react-datepicker`
1. Run `yarn install` from project root
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
[![Test suite](https://github.com/Hacker0x01/react-datepicker/actions/workflows/test.yml/badge.svg)](https://github.com/Hacker0x01/react-datepicker/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/Hacker0x01/react-datepicker/branch/master/graph/badge.svg)](https://codecov.io/gh/Hacker0x01/react-datepicker)
[![Downloads](https://img.shields.io/npm/dm/react-datepicker.svg)](https://npmjs.org/package/react-datepicker)
[![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)
[![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)

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

Expand Down Expand Up @@ -170,4 +168,4 @@ The examples are hosted within the docs folder and are ran in the simple app tha

## License

Copyright (c) 2014-2021 HackerOne Inc. and individual contributors. Licensed under MIT license, see [LICENSE](LICENSE) for the full license.
Copyright (c) 2014-2023 HackerOne Inc. and individual contributors. Licensed under MIT license, see [LICENSE](LICENSE) for the full license.
4 changes: 2 additions & 2 deletions docs-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"highlight.js": "^11.6.0",
"highlight.js": "^11.7.0",
"react": "^18.2.0",
"react-app-rewired": "^2.2.1",
"react-dom": "^18.2.0",
Expand Down Expand Up @@ -32,7 +32,7 @@
]
},
"devDependencies": {
"sass": "^1.55.0",
"sass": "^1.57.1",
"raw-loader": "^4.0.2"
}
}
15 changes: 15 additions & 0 deletions docs-site/src/components/Examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ import LocaleWithTime from "../../examples/localeWithTime";
import LocaleWithoutGlobalVariable from "../../examples/localeWithoutGlobalVariable";
import ExcludeDates from "../../examples/excludeDates";
import ExcludeDateIntervals from "../../examples/excludeDateIntervals";
import ExcludeDatesMonthPicker from "../../examples/excludeDatesMonthPicker";
import HighlightDates from "../../examples/highlightDates";
import HighlightDatesRanges from "../../examples/highlightDatesRanges";
import IncludeDates from "../../examples/includeDates";
import IncludeDateIntervals from "../../examples/includeDateIntervals";
import IncludeDatesMonthPicker from "../../examples/includeDatesMonthPicker";
import FilterDates from "../../examples/filterDates";
import DateRange from "../../examples/dateRange";
import DateRangeInputWithClearButton from "../../examples/dateRangeInputWithClearButton";
Expand Down Expand Up @@ -87,6 +89,7 @@ import CloseOnScrollCallback from "../../examples/closeOnScrollCallback";
import SelectsRange from "../../examples/selectsRange";
import selectsRangeWithDisabledDates from "../../examples/selectsRangeWithDisabledDates";
import CalendarStartDay from "../../examples/calendarStartDay";
import ExternalForm from "../../examples/externalForm";

import "./style.scss";
import "react-datepicker/dist/react-datepicker.css";
Expand Down Expand Up @@ -230,6 +233,10 @@ export default class exampleComponents extends React.Component {
title: "Exclude date intervals",
component: ExcludeDateIntervals,
},
{
title: "Exclude Months in Month Picker",
component: ExcludeDatesMonthPicker,
},
{
title: "Exclude Times",
component: ExcludeTimes,
Expand Down Expand Up @@ -266,6 +273,10 @@ export default class exampleComponents extends React.Component {
title: "Include date intervals",
component: IncludeDateIntervals,
},
{
title: "Include Months in Month Picker",
component: IncludeDatesMonthPicker,
},
{
title: "Include Times",
component: IncludeTimes,
Expand Down Expand Up @@ -446,6 +457,10 @@ export default class exampleComponents extends React.Component {
title: "Calendar Start day",
component: CalendarStartDay,
},
{
title: "External Form",
component: ExternalForm,
},
];

handleAnchorClick = (e, id) => {
Expand Down
12 changes: 12 additions & 0 deletions docs-site/src/examples/excludeDatesMonthPicker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
() => {
const [startDate, setStartDate] = useState(1659312000000);
return (
<DatePicker
selected={startDate}
onChange={(date) => setStartDate(date)}
dateFormat="MM/yyyy"
excludeDates={[1661990400000, 1664582400000, 1667260800000, 1672531200000]}
showMonthYearPicker
/>
);
};
17 changes: 17 additions & 0 deletions docs-site/src/examples/externalForm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
() => {
const [startDate, setStartDate] = useState(null);

return (
<>
<DatePicker
selected={startDate}
onChange={(date) => setStartDate(date)}
required
form="external-form"
/>
<form id="external-form">
<input type="submit" />
</form>
</>
);
};
12 changes: 12 additions & 0 deletions docs-site/src/examples/includeDatesMonthPicker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
() => {
const [startDate, setStartDate] = useState(1661990400000);
return (
<DatePicker
selected={startDate}
onChange={(date) => setStartDate(date)}
dateFormat="MM/yyyy"
includeDates={[1661990400000, 1664582400000, 1667260800000, 1672531200000]}
showMonthYearPicker
/>
);
};

0 comments on commit c570302

Please sign in to comment.