@izonnet-web-solution/react-native-date-time-picker-kit 0.0.0-stage → 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/DateTimePickerKit.podspec +22 -0
- package/LICENSE +20 -0
- package/README.md +652 -2
- package/android/build.gradle +36 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/datetimepickerkit/DatePickerHelper.kt +185 -0
- package/android/src/main/java/com/datetimepickerkit/DateTimePickerHelper.kt +214 -0
- package/android/src/main/java/com/datetimepickerkit/DateTimePickerKitModule.kt +258 -0
- package/android/src/main/java/com/datetimepickerkit/DateTimePickerKitPackage.kt +30 -0
- package/android/src/main/java/com/datetimepickerkit/TimePickerHelper.kt +208 -0
- package/ios/DateTimePickerKit.h +11 -0
- package/ios/DateTimePickerKit.mm +84 -0
- package/ios/DateTimePickerModule.swift +474 -0
- package/lib/module/NativeDateTimePickerKit.js +5 -0
- package/lib/module/NativeDateTimePickerKit.js.map +1 -0
- package/lib/module/components/CalendarPicker.js +419 -0
- package/lib/module/components/CalendarPicker.js.map +1 -0
- package/lib/module/components/ClockPicker.js +273 -0
- package/lib/module/components/ClockPicker.js.map +1 -0
- package/lib/module/components/DatePicker.js +181 -0
- package/lib/module/components/DatePicker.js.map +1 -0
- package/lib/module/components/DateRangePicker.js +158 -0
- package/lib/module/components/DateRangePicker.js.map +1 -0
- package/lib/module/components/DateTimePicker.js +674 -0
- package/lib/module/components/DateTimePicker.js.map +1 -0
- package/lib/module/components/MonthPicker.js +145 -0
- package/lib/module/components/MonthPicker.js.map +1 -0
- package/lib/module/components/TimePicker.js +142 -0
- package/lib/module/components/TimePicker.js.map +1 -0
- package/lib/module/components/TimeSlotPicker.js +118 -0
- package/lib/module/components/TimeSlotPicker.js.map +1 -0
- package/lib/module/components/WheelPicker.js +159 -0
- package/lib/module/components/WheelPicker.js.map +1 -0
- package/lib/module/components/YearPicker.js +151 -0
- package/lib/module/components/YearPicker.js.map +1 -0
- package/lib/module/components/common/ModalWrapper.js +136 -0
- package/lib/module/components/common/ModalWrapper.js.map +1 -0
- package/lib/module/components/common/PickerHeader.js +82 -0
- package/lib/module/components/common/PickerHeader.js.map +1 -0
- package/lib/module/components/common/PresetsBar.js +66 -0
- package/lib/module/components/common/PresetsBar.js.map +1 -0
- package/lib/module/errors/DateTimePickerError.js +12 -0
- package/lib/module/errors/DateTimePickerError.js.map +1 -0
- package/lib/module/hooks/useDateTimePicker.js +73 -0
- package/lib/module/hooks/useDateTimePicker.js.map +1 -0
- package/lib/module/index.js +40 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/localization/index.js +6 -0
- package/lib/module/localization/index.js.map +1 -0
- package/lib/module/localization/locales.js +186 -0
- package/lib/module/localization/locales.js.map +1 -0
- package/lib/module/localization/types.js +2 -0
- package/lib/module/localization/types.js.map +1 -0
- package/lib/module/localization/useLocale.js +176 -0
- package/lib/module/localization/useLocale.js.map +1 -0
- package/lib/module/native/NativeDateTimePicker.js +110 -0
- package/lib/module/native/NativeDateTimePicker.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/presets/datePresets.js +75 -0
- package/lib/module/presets/datePresets.js.map +1 -0
- package/lib/module/presets/index.js +4 -0
- package/lib/module/presets/index.js.map +1 -0
- package/lib/module/slots/index.js +4 -0
- package/lib/module/slots/index.js.map +1 -0
- package/lib/module/slots/timeSlots.js +59 -0
- package/lib/module/slots/timeSlots.js.map +1 -0
- package/lib/module/theme/defaultTheme.js +91 -0
- package/lib/module/theme/defaultTheme.js.map +1 -0
- package/lib/module/theme/index.js +6 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/types.js +2 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/theme/useTheme.js +81 -0
- package/lib/module/theme/useTheme.js.map +1 -0
- package/lib/module/types/events.js +4 -0
- package/lib/module/types/events.js.map +1 -0
- package/lib/module/types/index.js +7 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/native.js +2 -0
- package/lib/module/types/native.js.map +1 -0
- package/lib/module/types/presentation.js +2 -0
- package/lib/module/types/presentation.js.map +1 -0
- package/lib/module/types/props.js +4 -0
- package/lib/module/types/props.js.map +1 -0
- package/lib/module/utils/constants.js +14 -0
- package/lib/module/utils/constants.js.map +1 -0
- package/lib/module/utils/dateConversion.js +224 -0
- package/lib/module/utils/dateConversion.js.map +1 -0
- package/lib/module/utils/dateFormatting.js +102 -0
- package/lib/module/utils/dateFormatting.js.map +1 -0
- package/lib/module/utils/dateValidation.js +161 -0
- package/lib/module/utils/dateValidation.js.map +1 -0
- package/lib/module/utils/index.js +7 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeDateTimePickerKit.d.ts +17 -0
- package/lib/typescript/src/NativeDateTimePickerKit.d.ts.map +1 -0
- package/lib/typescript/src/components/CalendarPicker.d.ts +51 -0
- package/lib/typescript/src/components/CalendarPicker.d.ts.map +1 -0
- package/lib/typescript/src/components/ClockPicker.d.ts +22 -0
- package/lib/typescript/src/components/ClockPicker.d.ts.map +1 -0
- package/lib/typescript/src/components/DatePicker.d.ts +44 -0
- package/lib/typescript/src/components/DatePicker.d.ts.map +1 -0
- package/lib/typescript/src/components/DateRangePicker.d.ts +56 -0
- package/lib/typescript/src/components/DateRangePicker.d.ts.map +1 -0
- package/lib/typescript/src/components/DateTimePicker.d.ts +7 -0
- package/lib/typescript/src/components/DateTimePicker.d.ts.map +1 -0
- package/lib/typescript/src/components/MonthPicker.d.ts +21 -0
- package/lib/typescript/src/components/MonthPicker.d.ts.map +1 -0
- package/lib/typescript/src/components/TimePicker.d.ts +31 -0
- package/lib/typescript/src/components/TimePicker.d.ts.map +1 -0
- package/lib/typescript/src/components/TimeSlotPicker.d.ts +18 -0
- package/lib/typescript/src/components/TimeSlotPicker.d.ts.map +1 -0
- package/lib/typescript/src/components/WheelPicker.d.ts +17 -0
- package/lib/typescript/src/components/WheelPicker.d.ts.map +1 -0
- package/lib/typescript/src/components/YearPicker.d.ts +14 -0
- package/lib/typescript/src/components/YearPicker.d.ts.map +1 -0
- package/lib/typescript/src/components/common/ModalWrapper.d.ts +11 -0
- package/lib/typescript/src/components/common/ModalWrapper.d.ts.map +1 -0
- package/lib/typescript/src/components/common/PickerHeader.d.ts +13 -0
- package/lib/typescript/src/components/common/PickerHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/common/PresetsBar.d.ts +12 -0
- package/lib/typescript/src/components/common/PresetsBar.d.ts.map +1 -0
- package/lib/typescript/src/errors/DateTimePickerError.d.ts +7 -0
- package/lib/typescript/src/errors/DateTimePickerError.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useDateTimePicker.d.ts +17 -0
- package/lib/typescript/src/hooks/useDateTimePicker.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +23 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/localization/index.d.ts +4 -0
- package/lib/typescript/src/localization/index.d.ts.map +1 -0
- package/lib/typescript/src/localization/locales.d.ts +12 -0
- package/lib/typescript/src/localization/locales.d.ts.map +1 -0
- package/lib/typescript/src/localization/types.d.ts +23 -0
- package/lib/typescript/src/localization/types.d.ts.map +1 -0
- package/lib/typescript/src/localization/useLocale.d.ts +31 -0
- package/lib/typescript/src/localization/useLocale.d.ts.map +1 -0
- package/lib/typescript/src/native/NativeDateTimePicker.d.ts +14 -0
- package/lib/typescript/src/native/NativeDateTimePicker.d.ts.map +1 -0
- package/lib/typescript/src/presets/datePresets.d.ts +8 -0
- package/lib/typescript/src/presets/datePresets.d.ts.map +1 -0
- package/lib/typescript/src/presets/index.d.ts +2 -0
- package/lib/typescript/src/presets/index.d.ts.map +1 -0
- package/lib/typescript/src/slots/index.d.ts +2 -0
- package/lib/typescript/src/slots/index.d.ts.map +1 -0
- package/lib/typescript/src/slots/timeSlots.d.ts +18 -0
- package/lib/typescript/src/slots/timeSlots.d.ts.map +1 -0
- package/lib/typescript/src/theme/defaultTheme.d.ts +9 -0
- package/lib/typescript/src/theme/defaultTheme.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +4 -0
- package/lib/typescript/src/theme/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/types.d.ts +76 -0
- package/lib/typescript/src/theme/types.d.ts.map +1 -0
- package/lib/typescript/src/theme/useTheme.d.ts +4 -0
- package/lib/typescript/src/theme/useTheme.d.ts.map +1 -0
- package/lib/typescript/src/types/events.d.ts +8 -0
- package/lib/typescript/src/types/events.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +5 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/types/native.d.ts +26 -0
- package/lib/typescript/src/types/native.d.ts.map +1 -0
- package/lib/typescript/src/types/presentation.d.ts +26 -0
- package/lib/typescript/src/types/presentation.d.ts.map +1 -0
- package/lib/typescript/src/types/props.d.ts +221 -0
- package/lib/typescript/src/types/props.d.ts.map +1 -0
- package/lib/typescript/src/utils/constants.d.ts +12 -0
- package/lib/typescript/src/utils/constants.d.ts.map +1 -0
- package/lib/typescript/src/utils/dateConversion.d.ts +46 -0
- package/lib/typescript/src/utils/dateConversion.d.ts.map +1 -0
- package/lib/typescript/src/utils/dateFormatting.d.ts +8 -0
- package/lib/typescript/src/utils/dateFormatting.d.ts.map +1 -0
- package/lib/typescript/src/utils/dateValidation.d.ts +46 -0
- package/lib/typescript/src/utils/dateValidation.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +5 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/package.json +191 -4
- package/src/NativeDateTimePickerKit.ts +19 -0
- package/src/components/CalendarPicker.tsx +623 -0
- package/src/components/ClockPicker.tsx +403 -0
- package/src/components/DatePicker.tsx +276 -0
- package/src/components/DateRangePicker.tsx +251 -0
- package/src/components/DateTimePicker.tsx +1028 -0
- package/src/components/MonthPicker.tsx +216 -0
- package/src/components/TimePicker.tsx +203 -0
- package/src/components/TimeSlotPicker.tsx +163 -0
- package/src/components/WheelPicker.tsx +229 -0
- package/src/components/YearPicker.tsx +228 -0
- package/src/components/common/ModalWrapper.tsx +192 -0
- package/src/components/common/PickerHeader.tsx +121 -0
- package/src/components/common/PresetsBar.tsx +104 -0
- package/src/errors/DateTimePickerError.ts +29 -0
- package/src/hooks/useDateTimePicker.ts +100 -0
- package/src/index.tsx +92 -0
- package/src/localization/index.ts +3 -0
- package/src/localization/locales.ts +499 -0
- package/src/localization/types.ts +21 -0
- package/src/localization/useLocale.ts +197 -0
- package/src/native/NativeDateTimePicker.ts +154 -0
- package/src/presets/datePresets.ts +97 -0
- package/src/presets/index.ts +1 -0
- package/src/slots/index.ts +1 -0
- package/src/slots/timeSlots.ts +89 -0
- package/src/theme/defaultTheme.ts +102 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/types.ts +82 -0
- package/src/theme/useTheme.ts +98 -0
- package/src/types/events.ts +8 -0
- package/src/types/index.ts +4 -0
- package/src/types/native.ts +28 -0
- package/src/types/presentation.ts +28 -0
- package/src/types/props.ts +291 -0
- package/src/utils/constants.ts +15 -0
- package/src/utils/dateConversion.ts +273 -0
- package/src/utils/dateFormatting.ts +166 -0
- package/src/utils/dateValidation.ts +178 -0
- package/src/utils/index.ts +4 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "DateTimePickerKit"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/Izonnet-Web-Solution/react-native-date-time-picker-kit/react-native-date-time-picker-kit.git", :tag => "v#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
|
|
17
|
+
s.private_header_files = "ios/**/*.h"
|
|
18
|
+
s.swift_version = "5.0"
|
|
19
|
+
s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES" }
|
|
20
|
+
|
|
21
|
+
install_modules_dependencies(s)
|
|
22
|
+
end
|
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 IzoMalay
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,653 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @izonnet-web-solution/react-native-date-time-picker-kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A complete, ultra-lightweight, customizable React Native Date & Time Picker library powered by **iOS (Swift + UIKit)** and **Android (Kotlin + Android SDK)** native TurboModules, plus a rich suite of pure React Native calendar and modal components.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@izonnet-web-solution/react-native-date-time-picker-kit)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[]()
|
|
8
|
+
[]()
|
|
9
|
+
[]()
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Screenshots & Previews
|
|
14
|
+
|
|
15
|
+
<div align="center">
|
|
16
|
+
|
|
17
|
+
| iOS Native UIDatePicker | Android Native DatePickerDialog | iOS DateTime Dual Mode |
|
|
18
|
+
| :---: | :---: | :---: |
|
|
19
|
+
| <img src="https://raw.githubusercontent.com/Izonnet-Web-Solution/react-native-date-time-picker-kit/main/docs/assets/ios_native_datepicker.png" width="260" alt="iOS Native DatePicker" /> | <img src="https://raw.githubusercontent.com/Izonnet-Web-Solution/react-native-date-time-picker-kit/main/docs/assets/android_native_datepicker.png" width="260" alt="Android Native DatePicker" /> | <img src="https://raw.githubusercontent.com/Izonnet-Web-Solution/react-native-date-time-picker-kit/main/docs/assets/ios_datetime_picker.png" width="260" alt="iOS DateTime Picker" /> |
|
|
20
|
+
|
|
21
|
+
| iOS Countdown Wheels | Components & Theming Overview |
|
|
22
|
+
| :---: | :---: |
|
|
23
|
+
| <img src="https://raw.githubusercontent.com/Izonnet-Web-Solution/react-native-date-time-picker-kit/main/docs/assets/ios_countdown_picker.png" width="260" alt="iOS Countdown Picker" /> | <img src="https://raw.githubusercontent.com/Izonnet-Web-Solution/react-native-date-time-picker-kit/main/docs/assets/ios_components_overview.png" width="260" alt="Components & Theming Overview" /> |
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Table of Contents
|
|
30
|
+
|
|
31
|
+
1. [Screenshots & Previews](#screenshots--previews)
|
|
32
|
+
2. [Features](#features)
|
|
33
|
+
3. [Platform Support & Architecture](#platform-support--architecture)
|
|
34
|
+
4. [Zero Dependency Policy](#zero-dependency-policy)
|
|
35
|
+
5. [Installation & Setup](#installation--setup)
|
|
36
|
+
- [iOS Setup](#ios-setup)
|
|
37
|
+
- [Android Setup](#android-setup)
|
|
38
|
+
6. [Quick Start](#quick-start)
|
|
39
|
+
7. [Presentation Modes](#presentation-modes)
|
|
40
|
+
8. [Theme System](#theme-system)
|
|
41
|
+
9. [Component Catalog](#component-catalog)
|
|
42
|
+
- [1. `DateTimePicker`](#1-datetimepicker-unified)
|
|
43
|
+
- [2. `DatePicker`](#2-datepicker)
|
|
44
|
+
- [3. `TimePicker`](#3-timepicker)
|
|
45
|
+
- [4. `DateRangePicker`](#4-daterangepicker)
|
|
46
|
+
- [5. `CalendarPicker`](#5-calendarpicker)
|
|
47
|
+
- [6. `MonthPicker`](#6-monthpicker)
|
|
48
|
+
- [7. `YearPicker`](#7-yearpicker)
|
|
49
|
+
- [8. `ClockPicker`](#8-clockpicker)
|
|
50
|
+
- [9. `WheelPicker`](#9-wheelpicker)
|
|
51
|
+
- [10. `TimeSlotPicker`](#10-timeslotpicker)
|
|
52
|
+
10. [Quick Date Presets](#quick-date-presets)
|
|
53
|
+
11. [Appointment Time Slots](#appointment-time-slots)
|
|
54
|
+
12. [Localization & RTL](#localization--rtl)
|
|
55
|
+
13. [Imperative Ref APIs](#imperative-ref-apis)
|
|
56
|
+
14. [Custom Hook (`useDateTimePicker`)](#custom-hook-usedatetimepicker)
|
|
57
|
+
15. [Date Validation & Conversion Utilities](#date-validation--conversion-utilities)
|
|
58
|
+
16. [Error Handling & Error Codes](#error-handling--error-codes)
|
|
59
|
+
17. [Props Reference Table](#props-reference-table)
|
|
60
|
+
18. [Compatibility Matrix](#compatibility-matrix)
|
|
61
|
+
19. [Contributing](#contributing)
|
|
62
|
+
20. [License](#license)
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- **True Native UI**: Native **Swift** (`UIDatePicker`) on iOS and **Kotlin** (`DatePickerDialog`, `TimePickerDialog`) on Android.
|
|
69
|
+
- **Zero Third-Party Runtime Dependencies**: No Moment.js, Day.js, date-fns, react-native-modal, or community picker wrappers.
|
|
70
|
+
- **TurboModule Architecture**: Typed React Native Codegen specifications with promise-based async operations and UI thread safety.
|
|
71
|
+
- **5 Presentation Modes**:
|
|
72
|
+
- `native`: Platform-native dialogs and sheet modals via TurboModules.
|
|
73
|
+
- `inline`: In-tree custom calendar/clock embedded directly in view hierarchy.
|
|
74
|
+
- `bottom-sheet`: Animated slide-up bottom sheet with grab handle and backdrop dimming.
|
|
75
|
+
- `modal`: Centered dialog with backdrop blur/dim.
|
|
76
|
+
- `fullscreen`: Fullscreen overlay modal.
|
|
77
|
+
- **Theme Engine**: Light mode, Dark mode, Automatic system detection, and custom `ThemeConfig` (colors, typography, spacing, border radii).
|
|
78
|
+
- **10 Specialized Components**: `DateTimePicker`, `DatePicker`, `TimePicker`, `DateRangePicker`, `CalendarPicker`, `MonthPicker`, `YearPicker`, `ClockPicker`, `WheelPicker`, `TimeSlotPicker`.
|
|
79
|
+
- **Advanced Features**: Date range selection, appointment time slot generator, quick presets (Today, Yesterday, Last 7 Days, This Month), marked dates with colored dots and badges.
|
|
80
|
+
- **Comprehensive Localization**: Device locale auto-detection, built-in locale presets (English, Hindi, Gujarati, Spanish, French, German, Arabic, Chinese, Japanese), custom locale overrides, and RTL layout support.
|
|
81
|
+
- **Developer Flexibility**: Declarative component, imperative ref methods, and custom React hook (`useDateTimePicker`).
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Platform Support & Architecture
|
|
86
|
+
|
|
87
|
+
| Platform | Native Technology | Architecture | Minimum Version |
|
|
88
|
+
| :--- | :--- | :--- | :--- |
|
|
89
|
+
| **iOS** | Swift 5.0 + UIKit (`UIDatePicker`, `UIViewController`) | TurboModule Spec (Obj-C++ JSI wrapper) | iOS 15.1+ |
|
|
90
|
+
| **Android** | Kotlin 1.9+ + Android SDK (`DatePickerDialog`, `TimePickerDialog`) | TurboModule Spec (JNI C++ / Java wrapper) | Android API 24+ (Android 7.0+) |
|
|
91
|
+
|
|
92
|
+
### React Native New Architecture & Expo Compatibility
|
|
93
|
+
|
|
94
|
+
- **React Native New Architecture (Fabric & TurboModules):** Fully supported natively with typed Codegen specifications on React Native 0.74 – 0.88+.
|
|
95
|
+
- **Expo Compatibility:** Fully compatible with **Expo Prebuild** (`npx expo run:ios`, `npx expo run:android`) and **Expo Development Client** (`expo-dev-client`).
|
|
96
|
+
- **Note on Expo Go:** Because this library incorporates high-performance native Swift and Kotlin TurboModules, it requires a custom development client (`npx expo run:ios/android`) rather than standard Expo Go. Pure in-tree JS modes (`inline`, `modal`, `bottom-sheet`) work across all React Native platforms.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Zero Dependency Policy
|
|
101
|
+
|
|
102
|
+
This library maintains **0 runtime dependencies**.
|
|
103
|
+
- All date calculations, range validations, leap-year handling, and token formatting are implemented in pure TypeScript.
|
|
104
|
+
- All animations utilize React Native's built-in `Animated` and native drivers.
|
|
105
|
+
- No heavy date libraries (`moment`, `date-fns`, `dayjs`) are introduced into your bundle.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Installation & Setup
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# npm
|
|
113
|
+
npm install @izonnet-web-solution/react-native-date-time-picker-kit
|
|
114
|
+
|
|
115
|
+
# yarn
|
|
116
|
+
yarn add @izonnet-web-solution/react-native-date-time-picker-kit
|
|
117
|
+
|
|
118
|
+
# pnpm
|
|
119
|
+
pnpm add @izonnet-web-solution/react-native-date-time-picker-kit
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### iOS Setup
|
|
123
|
+
|
|
124
|
+
Install CocoaPods dependencies:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
cd ios && pod install
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The podspec automatically configures the Swift TurboModule (`DateTimePickerKitImpl`) and module headers.
|
|
131
|
+
|
|
132
|
+
### Android Setup
|
|
133
|
+
|
|
134
|
+
In your React Native project, ensure New Architecture is enabled (standard in RN 0.76+):
|
|
135
|
+
|
|
136
|
+
```properties
|
|
137
|
+
# android/gradle.properties
|
|
138
|
+
newArchEnabled=true
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Quick Start
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import React, { useState } from 'react';
|
|
147
|
+
import { View, Button, Text } from 'react-native';
|
|
148
|
+
import {
|
|
149
|
+
DateTimePicker,
|
|
150
|
+
formatDate,
|
|
151
|
+
} from '@izonnet-web-solution/react-native-date-time-picker-kit';
|
|
152
|
+
|
|
153
|
+
export default function BasicExample() {
|
|
154
|
+
const [date, setDate] = useState(new Date());
|
|
155
|
+
const [show, setShow] = useState(false);
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<View style={{ padding: 20 }}>
|
|
159
|
+
<Text>Selected: {formatDate(date, 'YYYY-MM-DD')}</Text>
|
|
160
|
+
<Button title="Choose Date" onPress={() => setShow(true)} />
|
|
161
|
+
|
|
162
|
+
{show && (
|
|
163
|
+
<DateTimePicker
|
|
164
|
+
mode="date"
|
|
165
|
+
presentation="native"
|
|
166
|
+
value={date}
|
|
167
|
+
onConfirm={(selectedDate) => {
|
|
168
|
+
setShow(false);
|
|
169
|
+
setDate(selectedDate);
|
|
170
|
+
}}
|
|
171
|
+
onCancel={() => setShow(false)}
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
174
|
+
</View>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Presentation Modes
|
|
182
|
+
|
|
183
|
+
All components support 5 presentation modes via the `presentation` prop:
|
|
184
|
+
|
|
185
|
+
| Mode | Description |
|
|
186
|
+
| :--- | :--- |
|
|
187
|
+
| `'native'` *(default)* | Native OS dialogs/sheets (`UIDatePicker` on iOS, `DatePickerDialog` on Android). |
|
|
188
|
+
| `'bottom-sheet'` | Slide-up bottom sheet with grab handle, backdrop dimming, and header. |
|
|
189
|
+
| `'modal'` | Center-aligned modal dialog. |
|
|
190
|
+
| `'inline'` | Directly rendered into the parent view tree without any modal overlay. |
|
|
191
|
+
| `'fullscreen'` | Fullscreen modal overlay with safe area padding. |
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
<DatePicker
|
|
195
|
+
presentation="bottom-sheet" // or "inline", "modal", "native"
|
|
196
|
+
value={new Date()}
|
|
197
|
+
onConfirmDate={(d) => console.log(d)}
|
|
198
|
+
/>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Theme System
|
|
204
|
+
|
|
205
|
+
Built-in themes support light mode, dark mode, auto system scheme, or customized palettes.
|
|
206
|
+
|
|
207
|
+
### Built-in Modes
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
<DateTimePicker theme="light" />
|
|
211
|
+
<DateTimePicker theme="dark" />
|
|
212
|
+
<DateTimePicker theme="auto" /> // Automatically follows device dark mode
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Custom Theme Configuration
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
const customTheme = {
|
|
219
|
+
mode: 'light',
|
|
220
|
+
colors: {
|
|
221
|
+
primary: '#6366F1', // Indigo accent
|
|
222
|
+
selected: '#6366F1',
|
|
223
|
+
selectedText: '#FFFFFF',
|
|
224
|
+
background: '#FAFAFA',
|
|
225
|
+
rangeHighlight: '#E0E7FF',
|
|
226
|
+
},
|
|
227
|
+
borderRadius: {
|
|
228
|
+
lg: 20,
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
<CalendarPicker theme={customTheme} />
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Component Catalog
|
|
238
|
+
|
|
239
|
+
### 1. `DateTimePicker` (Unified)
|
|
240
|
+
|
|
241
|
+
The core unified component supporting all modes (`date`, `time`, `datetime`, `countdown`) and presentations.
|
|
242
|
+
|
|
243
|
+
```tsx
|
|
244
|
+
<DateTimePicker
|
|
245
|
+
mode="datetime"
|
|
246
|
+
presentation="bottom-sheet"
|
|
247
|
+
value={new Date()}
|
|
248
|
+
minuteInterval={5}
|
|
249
|
+
onConfirm={(date) => console.log('Confirmed:', date)}
|
|
250
|
+
/>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### 2. `DatePicker`
|
|
254
|
+
|
|
255
|
+
Dedicated single date picker component with optional presets.
|
|
256
|
+
|
|
257
|
+
```tsx
|
|
258
|
+
const pickerRef = useRef<DatePickerRef>(null);
|
|
259
|
+
|
|
260
|
+
<DatePicker
|
|
261
|
+
ref={pickerRef}
|
|
262
|
+
presentation="bottom-sheet"
|
|
263
|
+
value={selectedDate}
|
|
264
|
+
showPresets
|
|
265
|
+
onConfirmDate={(date) => setSelectedDate(date)}
|
|
266
|
+
/>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 3. `TimePicker`
|
|
270
|
+
|
|
271
|
+
Dedicated time picker component supporting 12h / 24h formats and minute intervals.
|
|
272
|
+
|
|
273
|
+
```tsx
|
|
274
|
+
<TimePicker
|
|
275
|
+
presentation="modal"
|
|
276
|
+
is24Hour={false}
|
|
277
|
+
minuteInterval={15}
|
|
278
|
+
onConfirmTime={(time) => console.log(time)}
|
|
279
|
+
/>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### 4. `DateRangePicker`
|
|
283
|
+
|
|
284
|
+
Select a start date and an end date with visual range highlighting and quick presets.
|
|
285
|
+
|
|
286
|
+
```tsx
|
|
287
|
+
<DateRangePicker
|
|
288
|
+
presentation="bottom-sheet"
|
|
289
|
+
showPresets
|
|
290
|
+
startDate={range.startDate}
|
|
291
|
+
endDate={range.endDate}
|
|
292
|
+
onConfirmRange={({ startDate, endDate }) => {
|
|
293
|
+
console.log('Range:', startDate, 'to', endDate);
|
|
294
|
+
}}
|
|
295
|
+
/>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### 5. `CalendarPicker`
|
|
299
|
+
|
|
300
|
+
Full-featured inline or standalone calendar component with marked dates and RTL support.
|
|
301
|
+
|
|
302
|
+
```tsx
|
|
303
|
+
<CalendarPicker
|
|
304
|
+
value={new Date()}
|
|
305
|
+
onChange={(d) => console.log(d)}
|
|
306
|
+
markedDates={{
|
|
307
|
+
'2026-11-20': { marked: true, dotColor: '#EF4444' },
|
|
308
|
+
'2026-11-25': { marked: true, dotColor: '#10B981' },
|
|
309
|
+
}}
|
|
310
|
+
firstDayOfWeek={0} // 0 = Sunday, 1 = Monday
|
|
311
|
+
/>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### 6. `MonthPicker`
|
|
315
|
+
|
|
316
|
+
3x4 month selection grid with decade navigation.
|
|
317
|
+
|
|
318
|
+
```tsx
|
|
319
|
+
<MonthPicker
|
|
320
|
+
value={{ year: 2026, month: 10 }}
|
|
321
|
+
onChange={({ year, month, date }) => {
|
|
322
|
+
console.log('Selected Month:', month, 'Year:', year);
|
|
323
|
+
}}
|
|
324
|
+
/>
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### 7. `YearPicker`
|
|
328
|
+
|
|
329
|
+
Decade-paginated year selection grid.
|
|
330
|
+
|
|
331
|
+
```tsx
|
|
332
|
+
<YearPicker
|
|
333
|
+
value={2026}
|
|
334
|
+
minYear={2000}
|
|
335
|
+
maxYear={2040}
|
|
336
|
+
onChange={(year) => console.log('Year:', year)}
|
|
337
|
+
/>
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### 8. `ClockPicker`
|
|
341
|
+
|
|
342
|
+
Interactive 12-hour / 24-hour digital clock picker with segmented hour/minute controls and AM/PM toggles.
|
|
343
|
+
|
|
344
|
+
```tsx
|
|
345
|
+
<ClockPicker
|
|
346
|
+
value={{ hour: 10, minute: 30 }}
|
|
347
|
+
is24Hour={false}
|
|
348
|
+
minuteInterval={5}
|
|
349
|
+
onChange={({ hour, minute, date }) => console.log(hour, minute)}
|
|
350
|
+
/>
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### 9. `WheelPicker`
|
|
354
|
+
|
|
355
|
+
Zero-dependency, smooth scroll wheel picker built on React Native's `ScrollView`.
|
|
356
|
+
|
|
357
|
+
```tsx
|
|
358
|
+
<WheelPicker
|
|
359
|
+
items={[
|
|
360
|
+
{ label: 'Morning (09:00 AM)', value: 'morning' },
|
|
361
|
+
{ label: 'Afternoon (01:00 PM)', value: 'afternoon' },
|
|
362
|
+
{ label: 'Evening (05:00 PM)', value: 'evening' },
|
|
363
|
+
]}
|
|
364
|
+
selectedValue="morning"
|
|
365
|
+
onChange={(val, index) => console.log(val)}
|
|
366
|
+
/>
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### 10. `TimeSlotPicker`
|
|
370
|
+
|
|
371
|
+
Appointment time slot selection grid with auto-generation and disabled slot support.
|
|
372
|
+
|
|
373
|
+
```tsx
|
|
374
|
+
<TimeSlotPicker
|
|
375
|
+
startTime="09:00"
|
|
376
|
+
endTime="17:00"
|
|
377
|
+
intervalMinutes={30}
|
|
378
|
+
disabledSlots={['12:00', '12:30']}
|
|
379
|
+
onSelectSlot={(slot) => console.log('Booked slot:', slot.id)}
|
|
380
|
+
/>
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## Quick Date Presets
|
|
386
|
+
|
|
387
|
+
Generate standard presets for single dates and date ranges:
|
|
388
|
+
|
|
389
|
+
```tsx
|
|
390
|
+
import {
|
|
391
|
+
getStandardRangePresets,
|
|
392
|
+
getStandardSinglePresets,
|
|
393
|
+
} from '@izonnet-web-solution/react-native-date-time-picker-kit';
|
|
394
|
+
|
|
395
|
+
// Built-in presets: Today, Yesterday, Last 7 Days, Last 30 Days, This Month, Next Month
|
|
396
|
+
const rangePresets = getStandardRangePresets();
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Appointment Time Slots
|
|
402
|
+
|
|
403
|
+
Generate slots for scheduling workflows:
|
|
404
|
+
|
|
405
|
+
```tsx
|
|
406
|
+
import { generateTimeSlots } from '@izonnet-web-solution/react-native-date-time-picker-kit';
|
|
407
|
+
|
|
408
|
+
const slots = generateTimeSlots({
|
|
409
|
+
startTime: '09:00',
|
|
410
|
+
endTime: '18:00',
|
|
411
|
+
intervalMinutes: 30,
|
|
412
|
+
disabledSlots: ['13:00', '13:30'], // Lunch break
|
|
413
|
+
is24Hour: false,
|
|
414
|
+
});
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## Localization & RTL
|
|
420
|
+
|
|
421
|
+
### Built-in Locales
|
|
422
|
+
|
|
423
|
+
- `en` (English - default)
|
|
424
|
+
- `hi` (Hindi - हिन्दी)
|
|
425
|
+
- `gu` (Gujarati - ગુજરાતી)
|
|
426
|
+
- `es` (Spanish - Español)
|
|
427
|
+
- `fr` (French - Français)
|
|
428
|
+
- `de` (German - Deutsch)
|
|
429
|
+
- `ar` (Arabic - العربية with automatic RTL layout)
|
|
430
|
+
- `zh` (Chinese - 中文)
|
|
431
|
+
- `ja` (Japanese - 日本語)
|
|
432
|
+
|
|
433
|
+
```tsx
|
|
434
|
+
<CalendarPicker locale="hi" />
|
|
435
|
+
<DateTimePicker locale="gu" />
|
|
436
|
+
<CalendarPicker locale="ar" /> // Flips weekday order and navigation arrows for RTL
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### Formatted Localized Output
|
|
440
|
+
|
|
441
|
+
```tsx
|
|
442
|
+
import { formatLocalized, hiLocale } from '@izonnet-web-solution/react-native-date-time-picker-kit';
|
|
443
|
+
|
|
444
|
+
const str = formatLocalized(new Date(), 'DD MMMM YYYY (dddd) A', hiLocale);
|
|
445
|
+
// Output: "19 नवंबर 2026 (गुरुवार) पूर्वाह्न"
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
## Imperative Ref APIs
|
|
451
|
+
|
|
452
|
+
Control pickers programmatically via React refs:
|
|
453
|
+
|
|
454
|
+
```tsx
|
|
455
|
+
const pickerRef = useRef<DateTimePickerRef>(null);
|
|
456
|
+
|
|
457
|
+
// Open picker
|
|
458
|
+
await pickerRef.current?.open();
|
|
459
|
+
|
|
460
|
+
// Programmatic confirm / cancel / close
|
|
461
|
+
await pickerRef.current?.confirm();
|
|
462
|
+
await pickerRef.current?.cancel();
|
|
463
|
+
await pickerRef.current?.close();
|
|
464
|
+
|
|
465
|
+
// Value access
|
|
466
|
+
const value = pickerRef.current?.getValue();
|
|
467
|
+
pickerRef.current?.setValue(new Date());
|
|
468
|
+
pickerRef.current?.reset();
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## Custom Hook (`useDateTimePicker`)
|
|
474
|
+
|
|
475
|
+
```tsx
|
|
476
|
+
import { useDateTimePicker } from '@izonnet-web-solution/react-native-date-time-picker-kit';
|
|
477
|
+
|
|
478
|
+
function HookExample() {
|
|
479
|
+
const { ref, open, isOpen } = useDateTimePicker({
|
|
480
|
+
mode: 'date',
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
return (
|
|
484
|
+
<View>
|
|
485
|
+
<Button title={isOpen ? 'Open' : 'Choose'} onPress={() => open()} />
|
|
486
|
+
<DateTimePicker ref={ref} mode="date" />
|
|
487
|
+
</View>
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
## Date Validation & Conversion Utilities
|
|
495
|
+
|
|
496
|
+
```tsx
|
|
497
|
+
import {
|
|
498
|
+
validateDate,
|
|
499
|
+
validateDateRange,
|
|
500
|
+
isDateDisabled,
|
|
501
|
+
isWeekdayDisabled,
|
|
502
|
+
validateMinuteInterval,
|
|
503
|
+
formatDate,
|
|
504
|
+
parseDate,
|
|
505
|
+
} from '@izonnet-web-solution/react-native-date-time-picker-kit';
|
|
506
|
+
|
|
507
|
+
// Check date validity
|
|
508
|
+
validateDate(new Date()); // true
|
|
509
|
+
|
|
510
|
+
// Format using custom tokens
|
|
511
|
+
formatDate(new Date(), 'YYYY-MM-DD hh:mm A'); // "2026-11-19 10:30 AM"
|
|
512
|
+
|
|
513
|
+
// Check disabled dates
|
|
514
|
+
isDateDisabled(new Date(), ['2026-12-25'], [0, 6]); // true if Dec 25 or Weekend
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## Error Handling & Error Codes
|
|
520
|
+
|
|
521
|
+
The library exposes strongly typed `DateTimePickerError` instances:
|
|
522
|
+
|
|
523
|
+
```tsx
|
|
524
|
+
import { DateTimePickerError, type DateTimePickerErrorCode } from '@izonnet-web-solution/react-native-date-time-picker-kit';
|
|
525
|
+
|
|
526
|
+
<DateTimePicker
|
|
527
|
+
onError={(error: DateTimePickerError) => {
|
|
528
|
+
console.error('Picker error code:', error.code);
|
|
529
|
+
console.error('Picker error message:', error.message);
|
|
530
|
+
}}
|
|
531
|
+
/>
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
Available error codes:
|
|
535
|
+
- `NATIVE_MODULE_NOT_FOUND`
|
|
536
|
+
- `PICKER_ALREADY_OPEN`
|
|
537
|
+
- `PICKER_NOT_OPEN`
|
|
538
|
+
- `INVALID_DATE`
|
|
539
|
+
- `INVALID_MODE`
|
|
540
|
+
- `INVALID_MINUTE_INTERVAL`
|
|
541
|
+
- `DATE_OUT_OF_RANGE`
|
|
542
|
+
- `UNSUPPORTED_FEATURE`
|
|
543
|
+
- `ACTIVITY_UNAVAILABLE`
|
|
544
|
+
- `PRESENTATION_FAILED`
|
|
545
|
+
- `UNKNOWN_ERROR`
|
|
546
|
+
|
|
547
|
+
---
|
|
548
|
+
|
|
549
|
+
## Props Reference Table
|
|
550
|
+
|
|
551
|
+
Complete reference for `<DateTimePicker />` and derived pickers (`DatePicker`, `TimePicker`, `DateRangePicker`, etc.):
|
|
552
|
+
|
|
553
|
+
| Prop | Type | Default | Required | Description |
|
|
554
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
555
|
+
| `mode` | `'date' \| 'time' \| 'datetime' \| 'countdown'` | `'date'` | No | Selection mode for the picker. |
|
|
556
|
+
| `value` | `Date \| number \| string \| null` | `null` | No | Controlled date value. Accepts a `Date` object, millisecond epoch number, or ISO string. |
|
|
557
|
+
| `defaultValue` | `Date \| number \| string \| null` | `null` | No | Uncontrolled initial date value. |
|
|
558
|
+
| `presentation` | `'native' \| 'inline' \| 'modal' \| 'bottom-sheet' \| 'fullscreen'` | `'native'` | No | Display presentation container. Native launches OS modal; others render pure in-tree UI. |
|
|
559
|
+
| `display` | `'default' \| 'compact' \| 'inline' \| 'spinner' \| 'clock'` | `'default'` | No | Visual style for native pickers on iOS and Android. |
|
|
560
|
+
| `open` | `boolean` | `false` | No | Controls modal visibility in declarative presentation modes. |
|
|
561
|
+
| `isVisible` | `boolean` | `false` | No | Convenience alias for `open` or `visible`. |
|
|
562
|
+
| `minimumDate` | `Date \| number \| string` | `undefined` | No | Lower date/time boundary. Clamps selection and disables dates prior to this value. |
|
|
563
|
+
| `minDate` | `Date \| number \| string` | `undefined` | No | Convenience alias for `minimumDate`. |
|
|
564
|
+
| `maximumDate` | `Date \| number \| string` | `undefined` | No | Upper date/time boundary. Clamps selection and disables dates after this value. |
|
|
565
|
+
| `maxDate` | `Date \| number \| string` | `undefined` | No | Convenience alias for `maximumDate`. |
|
|
566
|
+
| `minimumTime` | `string \| { hour: number; minute: number }` | `undefined` | No | Minimum allowable time boundary (e.g. `"09:00"` or `{ hour: 9, minute: 0 }`). |
|
|
567
|
+
| `maximumTime` | `string \| { hour: number; minute: number }` | `undefined` | No | Maximum allowable time boundary (e.g. `"17:00"` or `{ hour: 17, minute: 0 }`). |
|
|
568
|
+
| `minuteInterval` | `1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 10 \| 12 \| 15 \| 20 \| 30` | `1` | No | Interval stepping for minute wheel or clock. |
|
|
569
|
+
| `locale` | `string \| PartialLocaleData` | Device locale | No | BCP 47 locale tag (`'en'`, `'es'`, `'fr'`, `'hi'`, `'ja'`, etc.) or custom locale dictionary. |
|
|
570
|
+
| `timeZone` | `string` | Device TZ | No | Target IANA timezone identifier (e.g., `'America/New_York'`, `'Asia/Kolkata'`). |
|
|
571
|
+
| `timeZoneOffsetInMinutes`| `number` | `undefined` | No | Target UTC offset in minutes (e.g. `330` for IST `+05:30`). |
|
|
572
|
+
| `utcOffset` | `number` | `undefined` | No | Convenience alias for `timeZoneOffsetInMinutes` (accepts hours e.g. `5.5` or minutes `330`). |
|
|
573
|
+
| `is24Hour` | `boolean` | Locale default | No | Explicit override for 24-hour time formatting instead of 12-hour AM/PM. |
|
|
574
|
+
| `disabledDates` | `(Date \| string)[]` | `[]` | No | Array of dates or ISO strings to disable from selection. |
|
|
575
|
+
| `disabledWeekdays` | `number[]` | `[]` | No | Array of weekday indices to disable (0 = Sunday, 1 = Monday, ..., 6 = Saturday). |
|
|
576
|
+
| `markedDates` | `MarkedDatesMap` | `{}` | No | Mapping of date keys (`YYYY-MM-DD`) with colored dots, badges, or custom highlights. |
|
|
577
|
+
| `firstDayOfWeek` | `number` | `0` (Sun) | No | First day of the week in calendar grids (0 = Sunday, 1 = Monday, 6 = Saturday). |
|
|
578
|
+
| `theme` | `'light' \| 'dark' \| 'auto' \| ThemeConfig` | `'auto'` | No | Visual theme mode or complete customized ThemeConfig design tokens. |
|
|
579
|
+
| `themeColors` | `ThemeColorsOverride` | `undefined` | No | Clean palette overrides (`backgroundColor`, `textColor`, `accentColor`, `dividerColor`). |
|
|
580
|
+
| `styles` | `{ headerStyle?, confirmButtonStyle?, cancelButtonStyle?, containerStyle? }` | `undefined` | No | Style overrides for modal container, header, and action buttons. |
|
|
581
|
+
| `title` | `string` | Mode title | No | Modal header or native dialog title. |
|
|
582
|
+
| `confirmText` | `string` | `'Confirm'` | No | Text label for the confirmation button. |
|
|
583
|
+
| `cancelText` | `string` | `'Cancel'` | No | Text label for the cancellation button. |
|
|
584
|
+
| `accentColor` | `string` | Theme primary | No | Accent color for active selections, highlights, and buttons. |
|
|
585
|
+
| `textColor` | `string` | Theme text | No | Base text color. |
|
|
586
|
+
| `backgroundColor` | `string` | Theme surface | No | Modal and component background color. |
|
|
587
|
+
| `showPresets` | `boolean` | `false` | No | Whether to show quick date presets bar (Today, Yesterday, Last 7 Days, This Month). |
|
|
588
|
+
| `customPresets` | `DatePreset[]` | `undefined` | No | Custom array of date presets to render. |
|
|
589
|
+
| `disabled` | `boolean` | `false` | No | When true, disables user interaction with the picker. |
|
|
590
|
+
| `onChange` | `(event: { date: Date; mode: string }) => void` | `undefined` | No | Callback invoked on intermediate date or time selection changes. |
|
|
591
|
+
| `onConfirm` | `(date: Date) => void` | `undefined` | No | Callback invoked when user confirms selection with the finalized `Date`. |
|
|
592
|
+
| `onCancel` | `() => void` | `undefined` | No | Callback invoked when user cancels or dismisses picker. |
|
|
593
|
+
| `onDismiss` | `() => void` | `undefined` | No | Callback invoked when native dialog is dismissed. |
|
|
594
|
+
| `onOpen` | `() => void` | `undefined` | No | Callback invoked when picker modal opens. |
|
|
595
|
+
| `onError` | `(error: DateTimePickerError) => void` | `undefined` | No | Callback invoked if an error occurs during presentation or date calculation. |
|
|
596
|
+
| `testID` | `string` | `undefined` | No | Identifier for end-to-end automated testing. |
|
|
597
|
+
|
|
598
|
+
---
|
|
599
|
+
|
|
600
|
+
## Compatibility Matrix
|
|
601
|
+
|
|
602
|
+
| Library Version | React Native | iOS | Android | New Architecture |
|
|
603
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
604
|
+
| `1.0.x` | `0.74.0` – `0.88.x+` | iOS 15.1+ | API 24+ (Android 7.0+) | **Yes (Required)** |
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## Contributing
|
|
609
|
+
|
|
610
|
+
We welcome community contributions, bug reports, and feature suggestions!
|
|
611
|
+
|
|
612
|
+
### Local Development Setup
|
|
613
|
+
|
|
614
|
+
1. **Clone the repository:**
|
|
615
|
+
```bash
|
|
616
|
+
git clone https://github.com/Izonnet-Web-Solution/react-native-date-time-picker-kit.git
|
|
617
|
+
cd react-native-date-time-picker-kit
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
2. **Install dependencies:**
|
|
621
|
+
```bash
|
|
622
|
+
npm install
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
3. **Run code quality checks & tests:**
|
|
626
|
+
```bash
|
|
627
|
+
# Run typechecks
|
|
628
|
+
npm run typecheck
|
|
629
|
+
|
|
630
|
+
# Run ESLint
|
|
631
|
+
npm run lint
|
|
632
|
+
|
|
633
|
+
# Run automated Jest test suite
|
|
634
|
+
npm test
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
4. **Build distribution binaries:**
|
|
638
|
+
```bash
|
|
639
|
+
npm run prepare
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
### Submitting Pull Requests
|
|
643
|
+
|
|
644
|
+
1. Fork the repo and create your feature branch: `git checkout -b feat/my-new-feature`.
|
|
645
|
+
2. Commit your changes with descriptive commit messages following Conventional Commits format (`feat:`, `fix:`, `docs:`, `test:`).
|
|
646
|
+
3. Ensure all 106+ unit tests pass and code passes `npm run lint` and `npm run typecheck`.
|
|
647
|
+
4. Open a Pull Request on GitHub with a clear explanation of your changes.
|
|
648
|
+
|
|
649
|
+
---
|
|
650
|
+
|
|
651
|
+
## License
|
|
652
|
+
|
|
653
|
+
MIT © [Izonnet Web Solution](https://github.com/izonnet-web-solution)
|