From 4aac5c1482bdb2bc9cb7e25badef68564321bd89 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 12 Sep 2025 13:08:11 +0300 Subject: [PATCH] Revert "temp remove date-picker" This reverts commit fa9e42c2fdd2478595165b99d2a3d4c3dd9060f7. --- package.json | 1 + patches/react-native-date-picker+5.0.13.patch | 17 ++++++++++++ .../forms/DateField/index.android.tsx | 27 +++++++++++++++++++ src/components/forms/DateField/index.tsx | 21 ++++++++++++++- yarn.lock | 5 ++++ 5 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 patches/react-native-date-picker+5.0.13.patch diff --git a/package.json b/package.json index b4e2932d5d..b816b1c4a1 100644 --- a/package.json +++ b/package.json @@ -184,6 +184,7 @@ "react-keyed-flatten-children": "^5.0.0", "react-native": "0.81.4", "react-native-compressor": "^1.12.0", + "react-native-date-picker": "^5.0.13", "react-native-device-attest": "^0.1.6", "react-native-drawer-layout": "^4.1.8", "react-native-edge-to-edge": "^1.6.0", diff --git a/patches/react-native-date-picker+5.0.13.patch b/patches/react-native-date-picker+5.0.13.patch new file mode 100644 index 0000000000..d815e08f30 --- /dev/null +++ b/patches/react-native-date-picker+5.0.13.patch @@ -0,0 +1,17 @@ +diff --git a/node_modules/react-native-date-picker/ios/RNDatePicker.h b/node_modules/react-native-date-picker/ios/RNDatePicker.h +index 480746e..470dc3a 100644 +--- a/node_modules/react-native-date-picker/ios/RNDatePicker.h ++++ b/node_modules/react-native-date-picker/ios/RNDatePicker.h +@@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_END + #else + #import "DatePicker.h" + #import ++#include + + @interface RNDatePicker : DatePicker + +@@ -22,4 +23,3 @@ NS_ASSUME_NONNULL_END + @end + + #endif +- diff --git a/src/components/forms/DateField/index.android.tsx b/src/components/forms/DateField/index.android.tsx index 57575b8f1a..2a89be7d3c 100644 --- a/src/components/forms/DateField/index.android.tsx +++ b/src/components/forms/DateField/index.android.tsx @@ -1,5 +1,6 @@ import {useCallback, useImperativeHandle, useState} from 'react' import {Keyboard} from 'react-native' +import DatePicker from 'react-native-date-picker' import {useLingui} from '@lingui/react' import {useTheme} from '#/alf' @@ -66,6 +67,32 @@ export function DateField({ isInvalid={isInvalid} accessibilityHint={accessibilityHint} /> + + {open && ( + // Android implementation of DatePicker currently does not change default button colors according to theme and only takes hex values for buttonColor + // Can remove the buttonColor setting if/when this PR is merged: https://github.com/henninghall/react-native-date-picker/pull/871 + + )} ) } diff --git a/src/components/forms/DateField/index.tsx b/src/components/forms/DateField/index.tsx index 6447890bf9..3683ee9e60 100644 --- a/src/components/forms/DateField/index.tsx +++ b/src/components/forms/DateField/index.tsx @@ -1,5 +1,6 @@ import {useCallback, useImperativeHandle} from 'react' import {Keyboard, View} from 'react-native' +import DatePicker from 'react-native-date-picker' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -79,7 +80,25 @@ export function DateField({ - + + +