Skip to content

Commit 6929161

Browse files
Merge remote-tracking branch 'origin/main' into improve-test-coverage
# Conflicts: # src/test/portal.test.tsx # src/test/tab_loop.test.tsx
2 parents 566ac8c + 2d58750 commit 6929161

File tree

12 files changed

+1998
-845
lines changed

12 files changed

+1998
-845
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,31 @@ You can use `onSelect` event handler which fires each time some calendar date ha
6262

6363
See [here](https://github.com/Hacker0x01/react-datepicker/blob/main/docs/datepicker.md) for a full list of props that may be passed to the component. Examples are given on the [main website](https://hacker0x01.github.io/react-datepicker).
6464

65+
### Working with Examples
66+
67+
When using examples from the documentation site, note that they may reference utilities from external libraries. Common imports you might need:
68+
69+
**Date manipulation** (from `date-fns`):
70+
71+
```js
72+
import { getYear, getMonth, addDays, subDays, setHours, setMinutes } from "date-fns";
73+
```
74+
75+
**Utility functions**:
76+
77+
- For `range()` function used in custom headers: `import range from "lodash/range";`
78+
- Or implement your own: `const range = (start, end, step) => Array.from({ length: (end - start) / step }, (_, i) => start + i * step);`
79+
80+
**TypeScript types**:
81+
82+
```ts
83+
import type { ReactDatePickerCustomHeaderProps } from "react-datepicker";
84+
```
85+
86+
All examples on the documentation site include commented import statements at the top showing exactly what you need to import for your own project.
87+
88+
For a comprehensive guide on imports, see the [Common Imports Guide](https://github.com/Hacker0x01/react-datepicker/blob/main/docs/imports-guide.md).
89+
6590
### Time picker
6691

6792
You can also include a time picker by adding the showTimeSelect prop

docs-site/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"copy-to-clipboard": "^3.3.3",
88
"date-fns": "^4.1.0",
9-
"esbuild-wasm": "^0.25.11",
9+
"esbuild-wasm": "^0.25.12",
1010
"highlight.js": "^11.11.1",
1111
"lodash": "^4.17.21",
1212
"prism-react-renderer": "^2.4.1",
@@ -24,21 +24,21 @@
2424
"type-check": "tsc --noEmit"
2525
},
2626
"devDependencies": {
27-
"@eslint/js": "^9.38.0",
27+
"@eslint/js": "^9.39.1",
2828
"@types/lodash": "^4.17.0",
2929
"@types/react": "^19.2.2",
3030
"@types/react-dom": "^19.2.2",
31-
"@typescript-eslint/eslint-plugin": "^8.46.2",
32-
"@typescript-eslint/parser": "^8.46.2",
31+
"@typescript-eslint/eslint-plugin": "^8.46.3",
32+
"@typescript-eslint/parser": "^8.46.3",
3333
"@vitejs/plugin-react": "^5.1.0",
34-
"eslint": "^9.38.0",
34+
"eslint": "^9.39.1",
3535
"eslint-plugin-react": "^7.37.5",
3636
"eslint-plugin-react-hooks": "^7.0.1",
3737
"eslint-plugin-react-refresh": "^0.4.24",
38-
"globals": "^16.4.0",
38+
"globals": "^16.5.0",
3939
"sass": "^1.93.2",
4040
"typescript": "^5.9.3",
41-
"vite": "^7.1.12"
41+
"vite": "^7.2.0"
4242
},
4343
"packageManager": "[email protected]"
4444
}

0 commit comments

Comments
 (0)