From 7a803a93b6ad8bb63dbae315fab8e4887c8a485c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Barbe?= Date: Mon, 1 Nov 2021 10:27:48 +0100 Subject: [PATCH 1/2] fix(analog-clock): add condition when selecting am 12 to return 00:00 --- src/Time/AnalogClock.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Time/AnalogClock.tsx b/src/Time/AnalogClock.tsx index 89ed928c..7cb0d5f3 100644 --- a/src/Time/AnalogClock.tsx +++ b/src/Time/AnalogClock.tsx @@ -70,11 +70,15 @@ function AnalogClock({ let pickedHours = getHours(angle, previousHourType) let hours12AndPm = !hours24 && modeRef.current === 'PM' + // Avoiding the "24h" // Should be 12h for 12 hours and PM mode if ((hours12AndPm || hours24) && pickedHours + 12 < 24) { pickedHours += 12 } + if (modeRef.current === 'AM' && pickedHours === 12) { + pickedHours = 0 + } if (pickedHours === 24) { pickedHours = 0 From 54fb0a0796b91d620f57666b3ca94d4119a9fa2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81re=CC=81my=20Barbe?= Date: Fri, 5 Nov 2021 20:54:26 +0100 Subject: [PATCH 2/2] fix(tests): fix jest issues --- example/src/App.tsx | 2 ++ example/src/ReadMeExampleDatePickerInput.tsx | 2 ++ jest.config.js | 10 ++++++++++ package.json | 7 ------- 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 jest.config.js diff --git a/example/src/App.tsx b/example/src/App.tsx index 6571af94..a391218c 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -198,6 +198,8 @@ function App() { value={inputDate} onChange={setInputDate} inputMode="start" + // FIXME : remove the ts error + // @ts-ignore autoCompleteType={'birthdate-full'} /> diff --git a/example/src/ReadMeExampleDatePickerInput.tsx b/example/src/ReadMeExampleDatePickerInput.tsx index 748b2cb4..e755bb5d 100644 --- a/example/src/ReadMeExampleDatePickerInput.tsx +++ b/example/src/ReadMeExampleDatePickerInput.tsx @@ -13,6 +13,8 @@ export default function ReadMeExampleDatePickerInput() { value={inputDate} onChange={(d) => setInputDate(d)} inputMode="start" + // FIXME : remove the ts error + // @ts-ignore autoCompleteType="birthdate-full" // mode="outlined" (see react-native-paper docs) // other react native TextInput props diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 00000000..9e95c21e --- /dev/null +++ b/jest.config.js @@ -0,0 +1,10 @@ +module.exports = { + preset: 'react-native', + modulePathIgnorePatterns: [ + '/example/node_modules', + '/lib/', + ], + transformIgnorePatterns: [ + '/node_modules/(?!(@react-native|react-native|react-native-iphone-x-helper)/)', + ], +} diff --git a/package.json b/package.json index 77c4c7e5..368baabe 100644 --- a/package.json +++ b/package.json @@ -75,13 +75,6 @@ "react-native-paper": "*", "react-native-vector-icons": "*" }, - "jest": { - "preset": "react-native", - "modulePathIgnorePatterns": [ - "/example/node_modules", - "/lib/" - ] - }, "husky": { "hooks": { "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",