jalaali-date-time-picker 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -8
- package/package.json +14 -17
package/README.md
CHANGED
|
@@ -2,14 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Production-ready Jalali (Persian) date + time picker for **React / Next.js**.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/jalaali-date-time-picker)
|
|
6
|
-
[](LICENSE)
|
|
7
|
-
[](https://tailwindcss.com)
|
|
8
|
-
[](https://ui.shadcn.dev)
|
|
9
|
-
[](https://www.typescriptlang.org/)
|
|
10
|
-
[](https://biomejs.dev)
|
|
11
|
-
---
|
|
12
|
-
|
|
13
5
|
- Fully typed
|
|
14
6
|
- Tree-shakable ESM build
|
|
15
7
|
- Built on Tailwind + ShadCN
|
|
@@ -83,6 +75,35 @@ export default function Page() {
|
|
|
83
75
|
|
|
84
76
|
See the full interactive demo [here](https://alijeyrad.github.io/jalaali-date-time-picker/).
|
|
85
77
|
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Props
|
|
81
|
+
|
|
82
|
+
| Prop | Type | Default | Description |
|
|
83
|
+
|------------------|---------------------------------------------------|--------------------|-------------|
|
|
84
|
+
| `className` | `string` | `""` | Optional Tailwind class |
|
|
85
|
+
| `defaultValue` | `Date` | `new Date()` | Default initial date |
|
|
86
|
+
| `value` | `Date` | `undefined` | Controlled value |
|
|
87
|
+
| `minDate` | `Date` | `1970-01-01` | Minimum date allowed |
|
|
88
|
+
| `maxDate` | `Date` | `2100-12-31` | Maximum date allowed |
|
|
89
|
+
| `disablePast` | `boolean` | `false` | Disallow past dates |
|
|
90
|
+
| `disableFuture` | `boolean` | `false` | Disallow future dates |
|
|
91
|
+
| `minuteStep` | `number` | `1` | Step for minute selection |
|
|
92
|
+
| `disabled` | `boolean` | `false` | Disable the picker |
|
|
93
|
+
| `showTime` | `boolean` | `true` | Show time picker |
|
|
94
|
+
| `format` | `"jalali" \| "gregorian"` | `"jalali"` | Date format to display |
|
|
95
|
+
| `clearable` | `boolean` | `false` | Show "clear" button |
|
|
96
|
+
| `inline` | `boolean` | `false` | Render in-place instead of a modal |
|
|
97
|
+
| `trigger` | `ReactNode` | `undefined` | Custom trigger component |
|
|
98
|
+
| `formatLabel` | `(date: Date) => string` | `undefined` | Custom display label formatter |
|
|
99
|
+
| `onChange` | `(date: Date) => void` | `undefined` | Callback when value changes |
|
|
100
|
+
| `onOpenChange` | `(open: boolean) => void` | `undefined` | Callback when modal opens/closes |
|
|
101
|
+
| `onClear` | `(prev: Date \| null) => void` | `undefined` | Callback when cleared |
|
|
102
|
+
| `inputRef` | `React.RefObject<HTMLInputElement>` | `undefined` | Ref to hidden input |
|
|
103
|
+
| `placeholderLabel` | `string` | `"انتخاب تاریخ و زمان"` | Placeholder |
|
|
104
|
+
| `inputFieldProps` | `InputFieldProps` | `undefined` | Pass props from RHF, Formik, etc. |
|
|
105
|
+
|
|
106
|
+
|
|
86
107
|
---
|
|
87
108
|
|
|
88
109
|
## Goal
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jalaali-date-time-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jalaali",
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"react",
|
|
18
18
|
"shamsi",
|
|
19
19
|
"tailwind",
|
|
20
|
-
"shadcn"
|
|
21
|
-
"lucide"
|
|
20
|
+
"shadcn"
|
|
22
21
|
],
|
|
23
22
|
"repository": {
|
|
24
23
|
"type": "git",
|
|
@@ -37,7 +36,9 @@
|
|
|
37
36
|
"main": "dist/index.cjs",
|
|
38
37
|
"types": "dist/index.d.ts",
|
|
39
38
|
"sideEffects": false,
|
|
40
|
-
"files": [
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
41
42
|
"scripts": {
|
|
42
43
|
"dev": "next dev --turbopack",
|
|
43
44
|
"build:site": "next build",
|
|
@@ -53,17 +54,7 @@
|
|
|
53
54
|
"@radix-ui/react-select": "^2.2.5",
|
|
54
55
|
"@radix-ui/react-separator": "^1.1.7",
|
|
55
56
|
"@radix-ui/react-slot": "^1.2.3",
|
|
56
|
-
"
|
|
57
|
-
"clsx": "^2.1.1",
|
|
58
|
-
"jalaali-js": "^1.2.8",
|
|
59
|
-
"lucide-react": ">=0.513",
|
|
60
|
-
"next": ">=14",
|
|
61
|
-
"next-themes": "^0.4.6",
|
|
62
|
-
"react": ">=18",
|
|
63
|
-
"react-dom": ">=18",
|
|
64
|
-
"react-hook-form": "^7.57.0",
|
|
65
|
-
"react-markdown": "^10.1.0",
|
|
66
|
-
"tailwind-merge": "^3.3.0"
|
|
57
|
+
"jalaali-js": "^1.2.8"
|
|
67
58
|
},
|
|
68
59
|
"devDependencies": {
|
|
69
60
|
"@biomejs/biome": "1.9.4",
|
|
@@ -72,14 +63,20 @@
|
|
|
72
63
|
"@types/node": "^20",
|
|
73
64
|
"@types/react": "^19",
|
|
74
65
|
"@types/react-dom": "^19",
|
|
66
|
+
"class-variance-authority": "^0.7.1",
|
|
67
|
+
"lucide-react": "^0.468.0",
|
|
68
|
+
"next": ">=14",
|
|
69
|
+
"next-themes": "^0.4.6",
|
|
70
|
+
"react": ">=18",
|
|
71
|
+
"react-dom": ">=18",
|
|
72
|
+
"react-hook-form": "^7.57.0",
|
|
73
|
+
"react-markdown": "^10.1.0",
|
|
75
74
|
"tailwindcss": "^4",
|
|
76
75
|
"tsup": "^8.5.0",
|
|
77
76
|
"tw-animate-css": "^1.3.4",
|
|
78
77
|
"typescript": "^5"
|
|
79
78
|
},
|
|
80
79
|
"peerDependencies": {
|
|
81
|
-
"lucide-react": ">=0.513",
|
|
82
|
-
"next": ">=14",
|
|
83
80
|
"react": ">=18",
|
|
84
81
|
"react-dom": ">=18",
|
|
85
82
|
"tailwindcss": ">=3"
|