react-native-calendar-picker+7.1.4.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. diff --git a/node_modules/react-native-calendar-picker/CalendarPicker/Day.js b/node_modules/react-native-calendar-picker/CalendarPicker/Day.js
  2. index f79b618..e163c31 100644
  3. --- a/node_modules/react-native-calendar-picker/CalendarPicker/Day.js
  4. +++ b/node_modules/react-native-calendar-picker/CalendarPicker/Day.js
  5. @@ -197,15 +197,43 @@ export default function Day(props) {
  6. );
  7. } else {
  8. return (
  9. - <View style={[styles.dayWrapper, custom.containerStyle]}>
  10. - <TouchableOpacity
  11. - disabled={!enableDateChange}
  12. - style={[custom.style, computedSelectedDayStyle, selectedDayStyle ]}
  13. - onPress={() => onPressDay({year, month, day}) }>
  14. - <Text style={[styles.dayLabel, textStyle, custom.textStyle, selectedDayTextStyle]}>
  15. - { day }
  16. - </Text>
  17. - </TouchableOpacity>
  18. + <View style={[styles.dayWrapper, custom.containerStyle, {position: 'relative'}]}>
  19. + {!(selectedStartDate && !selectedEndDate && isThisDaySameAsSelectedStart) && (
  20. + <TouchableOpacity
  21. + disabled={!enableDateChange}
  22. + style={[custom.style, computedSelectedDayStyle, selectedDayStyle]}
  23. + onPress={() => onPressDay({year, month, day}) }>
  24. + <Text style={[
  25. + styles.dayLabel,
  26. + textStyle,
  27. + custom.textStyle,
  28. + selectedDayTextStyle,
  29. + { color: '#0F3F4F' },
  30. + (thisDay.isSame(today, 'day') && (isThisDaySameAsSelectedStart || isThisDaySameAsSelectedEnd)) && { borderWidth: 0 }
  31. + ]}>
  32. + { day }
  33. + </Text>
  34. + </TouchableOpacity>
  35. + )}
  36. +
  37. + {(thisDay.isSame(selectedStartDate, 'day') || thisDay.isSame(selectedEndDate, 'day')) && (
  38. + <TouchableOpacity
  39. + disabled={!enableDateChange}
  40. + style={[{position: 'absolute'}]}
  41. + onPress={() => onPressDay({year, month, day}) }>
  42. + <Text style={[styles.dayLabel, textStyle, custom.textStyle, selectedDayTextStyle, {
  43. + backgroundColor: '#0F3F4F',
  44. + borderRadius: 17,
  45. + height: 34,
  46. + width: 34,
  47. + textAlign: 'center',
  48. + verticalAlign: 'middle',
  49. + overflow: 'hidden',
  50. + }]}>
  51. + { day }
  52. + </Text>
  53. + </TouchableOpacity>
  54. + )}
  55. </View>
  56. );
  57. }