Skip to content

Commit 3f2eeb6

Browse files
authored
Merge branch 'react-native-datetimepicker:master' into fix/fabric-width-override-ios
2 parents ff5f32e + 8b1e62e commit 3f2eeb6

File tree

12 files changed

+3765
-3586
lines changed

12 files changed

+3765
-3586
lines changed

.circleci/config.yml

Lines changed: 0 additions & 193 deletions
This file was deleted.

.detoxrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
simulator: {
1010
type: 'ios.simulator',
1111
device: {
12-
type: 'iPhone 15 Pro Max',
12+
type: 'iPhone 17 Pro Max',
1313
},
1414
},
1515
emulator: {

.github/workflows/test.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
analyse_js:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- run: corepack enable
18+
- uses: actions/setup-node@v6
19+
with:
20+
node-version: lts/*
21+
cache: yarn
22+
- run: yarn install --immutable
23+
- name: Run ESLint
24+
run: yarn lint
25+
- name: Jest
26+
run: yarn test
27+
28+
e2e_ios:
29+
runs-on: macos-26
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
- arch: old
35+
pod-env: 'RCT_NEW_ARCH_ENABLED=0'
36+
- arch: new
37+
pod-env: 'RCT_NEW_ARCH_ENABLED=1'
38+
name: e2e_ios (${{ matrix.arch }} arch)
39+
env:
40+
DEVELOPER_DIR: /Applications/Xcode_26.3.app/Contents/Developer
41+
steps:
42+
- uses: actions/checkout@v6
43+
- name: Boot iPhone 17 Pro Max simulator
44+
run: |
45+
DEVICE_ID=$(xcrun simctl list devices available -j | jq -r '.devices | to_entries[] | .value[] | select(.name == "iPhone 17 Pro Max") | .udid' | head -1)
46+
xcrun simctl boot "$DEVICE_ID"
47+
- name: Install applesimutils
48+
run: |
49+
HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
50+
HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
51+
- run: corepack enable
52+
- uses: actions/setup-node@v6
53+
with:
54+
node-version: lts/*
55+
cache: yarn
56+
- run: yarn install --immutable
57+
- name: Bundle JS
58+
run: yarn bundle:ios
59+
- uses: actions/cache@v5
60+
with:
61+
path: example/ios/Pods
62+
key: pods-${{ matrix.arch }}-${{ runner.os }}-${{ hashFiles('example/ios/Podfile.lock') }}
63+
- name: Pod install
64+
run: cd example && ${{ matrix.pod-env }} RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 npx pod-install
65+
- name: Build app for e2e tests
66+
run: yarn detox:ios:build:release
67+
- name: Run e2e tests
68+
run: yarn detox:ios:test:release
69+
- uses: actions/upload-artifact@v7
70+
if: failure()
71+
with:
72+
name: ios-e2e-${{ matrix.arch }}-artifacts
73+
path: artifacts
74+
retention-days: 14
75+
76+
e2e_android:
77+
runs-on: ubuntu-latest
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
include:
82+
- arch: old
83+
new-arch-enabled: false
84+
- arch: new
85+
new-arch-enabled: true
86+
name: e2e_android (${{ matrix.arch }} arch)
87+
env:
88+
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError" -Dorg.gradle.daemon=false'
89+
steps:
90+
- uses: actions/checkout@v6
91+
- run: corepack enable
92+
- uses: actions/setup-node@v6
93+
with:
94+
node-version: lts/*
95+
cache: yarn
96+
- uses: actions/setup-java@v5
97+
with:
98+
distribution: zulu
99+
java-version: 17
100+
- uses: actions/cache@v5
101+
with:
102+
path: |
103+
~/.gradle/caches
104+
~/.gradle/wrapper
105+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
106+
- run: yarn install --immutable
107+
- name: Bundle JS
108+
run: yarn bundle:android
109+
- run: yarn generateManifest
110+
- name: Build app for e2e tests
111+
run: ORG_GRADLE_PROJECT_newArchEnabled=${{ matrix.new-arch-enabled }} yarn detox:android:build:release
112+
- name: Enable KVM
113+
run: |
114+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
115+
sudo udevadm control --reload-rules
116+
sudo udevadm trigger --name-match=kvm
117+
- name: Run e2e tests
118+
uses: reactivecircus/android-emulator-runner@v2
119+
with:
120+
api-level: 29
121+
avd-name: TestingAVD
122+
profile: pixel_6_pro
123+
disable-animations: true
124+
script: |
125+
adb root
126+
adb wait-for-device
127+
adb shell setprop persist.sys.timezone "Europe/Prague"
128+
adb shell settings put global auto_time_zone 0
129+
adb shell am broadcast -a android.intent.action.TIMEZONE_CHANGED
130+
adb shell getprop persist.sys.timezone
131+
yarn detox:android:test:release
132+
- uses: actions/upload-artifact@v7
133+
if: failure()
134+
with:
135+
name: android-e2e-${{ matrix.arch }}-artifacts
136+
path: artifacts
137+
retention-days: 14

example/App.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
} from 'react-native';
1717
import DateTimePicker from '@react-native-community/datetimepicker';
1818
import SegmentedControl from './SegmentedControl';
19-
import {Colors} from 'react-native/Libraries/NewAppScreen';
2019
import React, {useRef, useState} from 'react';
2120
import {Picker} from 'react-native-windows';
2221
import moment from 'moment-timezone';
@@ -29,6 +28,13 @@ import {
2928
} from '@react-native-community/datetimepicker/src/constants';
3029
import * as RNLocalize from 'react-native-localize';
3130

31+
const Colors = {
32+
white: '#FFFFFF',
33+
black: '#000000',
34+
dark: '#333333',
35+
lighter: '#F5F5F5',
36+
}
37+
3238
const timezone = [
3339
120,
3440
0,
@@ -385,7 +391,10 @@ export const App = () => {
385391
startOnYearSelection (android only)
386392
</ThemedText>
387393
<View style={{flex: 1, alignItems: 'flex-start'}}>
388-
<Switch value={startOnYearSelection} onValueChange={setStartOnYearSelection} />
394+
<Switch
395+
value={startOnYearSelection}
396+
onValueChange={setStartOnYearSelection}
397+
/>
389398
</View>
390399
</View>
391400
<View style={styles.header}>
@@ -487,7 +496,11 @@ export const App = () => {
487496
setShow(true);
488497
}
489498
}}
490-
title={minimumDate && maximumDate && minimumDate > maximumDate ? "undo min > max" : "set min > max (errors)"}
499+
title={
500+
minimumDate && maximumDate && minimumDate > maximumDate
501+
? 'undo min > max'
502+
: 'set min > max (errors)'
503+
}
491504
/>
492505
</View>
493506
<View style={{flexDirection: 'row', alignItems: 'center'}}>

0 commit comments

Comments
 (0)