Skip to content

Commit 0456dcc

Browse files
Bugfixes
1 parent 9e48b21 commit 0456dcc

File tree

6 files changed

+60
-80
lines changed

6 files changed

+60
-80
lines changed

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ PODS:
298298
- React-jsi (= 0.63.2)
299299
- RNLocalize (1.4.2):
300300
- React-Core
301-
- RNVectorIcons (7.1.0):
301+
- RNVectorIcons (7.0.0):
302302
- React
303303
- Yoga (1.14.0)
304304
- YogaKit (1.18.1):
@@ -466,7 +466,7 @@ SPEC CHECKSUMS:
466466
React-RCTVibration: 4d2e726957f4087449739b595f107c0d4b6c2d2d
467467
ReactCommon: a0a1edbebcac5e91338371b72ffc66aa822792ce
468468
RNLocalize: 452d4118e338dee1e5ca3fac4d5a11a4ab26a46a
469-
RNVectorIcons: bc69e6a278b14842063605de32bec61f0b251a59
469+
RNVectorIcons: da6fe858f5a65d7bbc3379540a889b0b12aa5976
470470
Yoga: 7740b94929bbacbddda59bf115b5317e9a161598
471471
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
472472

example/ios/example.xcodeproj/project.pbxproj

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -407,41 +407,13 @@
407407
inputPaths = (
408408
"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh",
409409
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
410-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
411-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
412-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Feather.ttf",
413-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf",
414-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf",
415-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf",
416-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf",
417-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf",
418-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf",
419-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf",
420410
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
421-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf",
422-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf",
423-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf",
424-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf",
425411
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
426412
);
427413
name = "[CP] Copy Pods Resources";
428414
outputPaths = (
429415
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf",
430-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf",
431-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf",
432-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf",
433-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf",
434-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf",
435-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf",
436-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf",
437-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf",
438-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf",
439-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf",
440416
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf",
441-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf",
442-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf",
443-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf",
444-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf",
445417
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
446418
);
447419
runOnlyForDeploymentPostprocessing = 0;
@@ -515,41 +487,13 @@
515487
inputPaths = (
516488
"${PODS_ROOT}/Target Support Files/Pods-example-exampleTests/Pods-example-exampleTests-resources.sh",
517489
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
518-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
519-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
520-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Feather.ttf",
521-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf",
522-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf",
523-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf",
524-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf",
525-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf",
526-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf",
527-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf",
528490
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
529-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf",
530-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf",
531-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf",
532-
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf",
533491
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
534492
);
535493
name = "[CP] Copy Pods Resources";
536494
outputPaths = (
537495
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf",
538-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf",
539-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf",
540-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf",
541-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf",
542-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf",
543-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf",
544-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf",
545-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf",
546-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf",
547-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf",
548496
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf",
549-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf",
550-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf",
551-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf",
552-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf",
553497
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
554498
);
555499
runOnlyForDeploymentPostprocessing = 0;

src/Date/DatePickerModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ const styles = StyleSheet.create({
195195
},
196196
modalContent: {
197197
flex: 1,
198+
width: '100%',
198199
},
199200
modalContentBig: {
200201
maxWidth: 600,

src/Time/TimeInputs.tsx

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,24 @@ function TimeInputs({
7878
<TimeInput
7979
ref={startInput}
8080
placeholder={'00'}
81-
value={hours}
81+
value={toInputFormat(hours, is24Hour)}
8282
clockType={clockTypes.hours}
8383
pressed={focused === clockTypes.hours}
8484
onPress={onFocusInput}
8585
inputType={inputType}
8686
returnKeyType={'next'}
8787
onSubmitEditing={onSubmitStartInput}
8888
blurOnSubmit={false}
89-
onChanged={(newHours) =>
89+
onChanged={(newHoursFromInput) => {
90+
let newHours = toOutputFormat(newHoursFromInput, hours, is24Hour)
91+
if (newHoursFromInput > 24) {
92+
newHours = 24
93+
}
9094
onChange({
9195
hours: newHours,
9296
minutes,
9397
})
94-
}
98+
}}
9599
// onChangeText={onChangeStartInput}
96100
/>
97101
<View style={styles.hoursAndMinutesSeparator}>
@@ -110,12 +114,16 @@ function TimeInputs({
110114
onPress={onFocusInput}
111115
inputType={inputType}
112116
onSubmitEditing={onSubmitEndInput}
113-
onChanged={(newMinutes) =>
117+
onChanged={(newMinutesFromInput) => {
118+
let newMinutes = newMinutesFromInput
119+
if (newMinutesFromInput > 60) {
120+
newMinutes = 60
121+
}
114122
onChange({
115123
hours,
116124
minutes: newMinutes,
117125
})
118-
}
126+
}}
119127
/>
120128
{!is24Hour && (
121129
<>
@@ -127,6 +135,29 @@ function TimeInputs({
127135
)
128136
}
129137

138+
function toInputFormat(hours: number, is24Hour: boolean): number {
139+
if (is24Hour) {
140+
return hours
141+
}
142+
if (hours > 12) {
143+
return hours - 12
144+
}
145+
return hours
146+
}
147+
function toOutputFormat(
148+
newHours: number,
149+
previousHours: number,
150+
is24Hour: boolean
151+
): number {
152+
if (is24Hour) {
153+
return newHours
154+
}
155+
if (previousHours > 12 && newHours <= 12) {
156+
return newHours + 12
157+
}
158+
return newHours
159+
}
160+
130161
const styles = StyleSheet.create({
131162
spaceBetweenInputsAndSwitcher: { width: 12 },
132163
inputContainer: {

src/Time/TimePicker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function TimePicker({
3434

3535
// method to check whether we have 24 hours in clock or 12
3636
const is24Hour = React.useMemo(() => {
37+
return false
3738
const formatter = new Intl.DateTimeFormat(undefined, {
3839
hour: '2-digit',
3940
minute: '2-digit',

src/Time/TimePickerModal.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,23 @@ export function TimePickerModal({
102102
statusBarTranslucent={true}
103103
>
104104
<>
105-
<KeyboardAvoidingView
106-
style={styles.keyboardView}
107-
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
108-
>
109-
<TouchableWithoutFeedback onPress={onDismiss}>
110-
<View
111-
style={[
112-
StyleSheet.absoluteFill,
113-
styles.modalBackground,
114-
{ backgroundColor: theme.colors.backdrop },
115-
]}
116-
/>
117-
</TouchableWithoutFeedback>
105+
<TouchableWithoutFeedback onPress={onDismiss}>
118106
<View
119-
style={[StyleSheet.absoluteFill, styles.modalRoot]}
120-
pointerEvents="box-none"
107+
style={[
108+
StyleSheet.absoluteFill,
109+
styles.modalBackground,
110+
{ backgroundColor: theme.colors.backdrop },
111+
]}
112+
/>
113+
</TouchableWithoutFeedback>
114+
115+
<View
116+
style={[StyleSheet.absoluteFill, styles.modalRoot]}
117+
pointerEvents="box-none"
118+
>
119+
<KeyboardAvoidingView
120+
style={styles.keyboardView}
121+
behavior={'padding'}
121122
>
122123
<Animated.View
123124
style={[
@@ -163,8 +164,8 @@ export function TimePickerModal({
163164
</Button>
164165
</View>
165166
</Animated.View>
166-
</View>
167-
</KeyboardAvoidingView>
167+
</KeyboardAvoidingView>
168+
</View>
168169
</>
169170
</Modal>
170171
)
@@ -186,6 +187,8 @@ const styles = StyleSheet.create({
186187
flex: 1,
187188
},
188189
keyboardView: {
190+
justifyContent: 'center',
191+
alignItems: 'center',
189192
flex: 1,
190193
},
191194
modalBackground: {

0 commit comments

Comments
 (0)