expo-2k-datetime-picker 1.0.0 → 1.0.1

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 CHANGED
@@ -26,6 +26,18 @@ npx expo install expo-2k-datetime-picker
26
26
 
27
27
  ---
28
28
 
29
+ ## Preview
30
+
31
+ | Date | Time |
32
+ | ----------------------------------- | ----------------------------------- |
33
+ | ![Date Picker](src/assets/date.png) | ![Time Picker](src/assets/time.png) |
34
+
35
+ | Datetime Range | Time Range |
36
+ | ------------------------------------------------ | ---------------------------------------- |
37
+ | ![Datetime Range](src/assets/datetime-range.png) | ![Time Range](src/assets/time-range.png) |
38
+
39
+ ---
40
+
29
41
  ## Usage
30
42
 
31
43
  ### Example 1 — Date Picker
@@ -120,8 +132,8 @@ import { useState } from "react";
120
132
 
121
133
  export default function App() {
122
134
  const [date, setDate] = useState<DateValueType>({
123
- start: new Date(),
124
- end: new Date(),
135
+ start: "09:00:00",
136
+ end: "10:00:00",
125
137
  });
126
138
 
127
139
  return (
@@ -139,63 +151,19 @@ export default function App() {
139
151
 
140
152
  ## Props
141
153
 
142
- | Prop | Type | Required | Description |
143
- | --------------- | ------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------- |
144
- | `onChangeDate` | `(value: DateValueType) => void` | ❌ | Callback fired when the user selects a date or range |
145
- | `value` | `DateValueType` | ❌ | Current selected value — a `Date` or `{ start: Date, end: Date }` object |
146
- | `locales` | `Intl.LocalesArgument` | ❌ | Locale for displaying month/day names and time format (e.g. `"fr"`, `"en-US"`). Defaults to device locale |
147
- | `mode` | `"date" \| "time" \| "datetime"` | ❌ | Picker mode |
148
- | `color` | `string` | ❌ | Accent color for the picker UI (any valid CSS/RN color) |
149
- | `min` | `Date` | ❌ | Earliest selectable date — all dates before this are automatically disabled |
150
- | `max` | `Date` | ❌ | Latest selectable date — all dates after this are automatically disabled |
151
- | `disableDate` | `(date: Date) => boolean` | ❌ | Function to disable specific dates — return `true` to disable |
152
- | `placeholder` | `string` | ❌ | Text shown in the trigger button when no date is selected yet |
153
- | `customTrigger` | `(onToggle: () => void) => React.ReactNode` | ❌ | Custom element to replace the default trigger button |
154
- | `disabled` | `boolean` | ❌ | Disables the entire picker — the trigger becomes non-interactive |
155
-
156
- ---
157
-
158
- ## Types
159
-
160
- ```ts
161
- // Single date or datetime
162
- type DateValueType = Date | { start: Date; end: Date };
163
- ```
164
-
165
- ---
166
-
167
- ## Working with the Selected Value
168
-
169
- `DateValueType` is a standard JavaScript `Date` object (or a pair of them for ranges). Use the built-in `Date` methods to extract any part of the selected value:
170
-
171
- ```tsx
172
- const date = new Date("2025-06-15T14:30:00");
173
-
174
- date.getFullYear(); // 2025
175
- date.getMonth(); // 5 (0-indexed, so 5 = June)
176
- date.getDate(); // 15
177
- date.getDay(); // 0–6 (day of the week, 0 = Sunday)
178
- date.getHours(); // 14
179
- date.getMinutes(); // 30
180
- date.getSeconds(); // 0
181
- date.toISOString(); // "2025-06-15T14:30:00.000Z"
182
- date.toLocaleDateString(); // "6/15/2025" (format depends on locale)
183
- date.toLocaleTimeString(); // "2:30:00 PM"
184
- ```
185
-
186
- For range values, access each bound separately:
187
-
188
- ```tsx
189
- const [date, setDate] = useState<DateValueType>({
190
- start: new Date(),
191
- end: new Date(),
192
- });
193
-
194
- if (date && "start" in date) {
195
- date.start.getDate(); // start day
196
- date.end.getFullYear(); // end year
197
- }
198
- ```
154
+ | Prop | Type | Required | Description |
155
+ | --------------- | ------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
156
+ | `onChangeDate` | `(value: DateValueType) => void` | ❌ | Callback fired when the user selects a date or range |
157
+ | `value` | `DateValueType` | ❌ | Current selected value — a `Date` or `{ start: Date, end: Date }` or HH:MM:SS or `{ start: 'HH:MM:SS', end: 'HH:MM:SS' }` object |
158
+ | `locales` | `Intl.LocalesArgument` | ❌ | Locale for displaying month/day names and time format (e.g. `"fr"`, `"en-US"`). Defaults to device locale |
159
+ | `mode` | `"date" \| "time" \| "datetime"` | ❌ | Picker mode |
160
+ | `color` | `string` | ❌ | Accent color for the picker UI (any valid CSS/RN color) |
161
+ | `min` | `Date` | ❌ | Earliest selectable date — all dates before this are automatically disabled |
162
+ | `max` | `Date` | ❌ | Latest selectable date — all dates after this are automatically disabled |
163
+ | `disableDate` | `(date: Date) => boolean` | ❌ | Function to disable specific dates — return `true` to disable |
164
+ | `placeholder` | `string` | ❌ | Text shown in the trigger button when no date is selected yet |
165
+ | `customTrigger` | `(onToggle: () => void) => React.ReactNode` | ❌ | Custom element to replace the default trigger button |
166
+ | `disabled` | `boolean` | ❌ | Disables the entire picker — the trigger becomes non-interactive |
199
167
 
200
168
  ---
201
169
 
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-2k-datetime-picker",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "The fastest fully customizable Expo date & time picker, written in TypeScript, supporting Expo Go, single date, time, date range, time range, datetime range selection, flexible date disabling, and dynamic color theming for iOS and Android.",
5
5
  "main": "build/Calendar2kView.js",
6
6
  "types": "build/Calendar2k.types.d.ts",
@@ -50,4 +50,4 @@
50
50
  "expo-go-compatible"
51
51
  ],
52
52
  "license": "MIT"
53
- }
53
+ }
Binary file
Binary file
Binary file
Binary file