react-native-calendars+1.1304.1.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. diff --git a/node_modules/react-native-calendars/src/calendar/day/period/index.js b/node_modules/react-native-calendars/src/calendar/day/period/index.js
  2. index f27db0e..434f414 100644
  3. --- a/node_modules/react-native-calendars/src/calendar/day/period/index.js
  4. +++ b/node_modules/react-native-calendars/src/calendar/day/period/index.js
  5. @@ -87,21 +87,19 @@ const PeriodDay = (props) => {
  6. return textStyle;
  7. }, [marking, state]);
  8. const fillerStyles = useMemo(() => {
  9. - const leftFillerStyle = { backgroundColor: undefined };
  10. - const rightFillerStyle = { backgroundColor: undefined };
  11. + const leftFillerStyle = { backgroundColor: marking?.disabled ? 'transparent' : 'rgb(250, 223, 194)' };
  12. + const rightFillerStyle = { backgroundColor: marking?.disabled ? 'transparent' : 'rgb(250, 223, 194)' };
  13. let fillerStyle = {};
  14. const start = markingStyle.startingDay;
  15. const end = markingStyle.endingDay;
  16. - if (start && !end) {
  17. - rightFillerStyle.backgroundColor = markingStyle.startingDay?.backgroundColor;
  18. + if (start) {
  19. + leftFillerStyle.backgroundColor = markingStyle.day?.backgroundColor;
  20. }
  21. - else if (end && !start) {
  22. - leftFillerStyle.backgroundColor = markingStyle.endingDay?.backgroundColor;
  23. + if (end) {
  24. + rightFillerStyle.backgroundColor = markingStyle.day?.backgroundColor;
  25. }
  26. - else if (markingStyle.day) {
  27. - leftFillerStyle.backgroundColor = markingStyle.day?.backgroundColor;
  28. - rightFillerStyle.backgroundColor = markingStyle.day?.backgroundColor;
  29. - fillerStyle = { backgroundColor: markingStyle.day?.backgroundColor };
  30. + if (!start && !end && markingStyle.day) {
  31. + fillerStyle = { backgroundColor: markingStyle.day?.backgroundColor };
  32. }
  33. return { leftFillerStyle, rightFillerStyle, fillerStyle };
  34. }, [marking]);
  35. diff --git a/node_modules/react-native-calendars/src/calendar/day/period/style.js b/node_modules/react-native-calendars/src/calendar/day/period/style.js
  36. index 51e2082..d82f5eb 100644
  37. --- a/node_modules/react-native-calendars/src/calendar/day/period/style.js
  38. +++ b/node_modules/react-native-calendars/src/calendar/day/period/style.js
  39. @@ -10,7 +10,7 @@ export default function styleConstructor(theme = {}) {
  40. marginLeft: -1
  41. },
  42. base: {
  43. - width: 38,
  44. + width: FILLER_HEIGHT,
  45. height: FILLER_HEIGHT,
  46. alignItems: 'center',
  47. justifyContent: 'center'
  48. @@ -44,7 +44,10 @@ export default function styleConstructor(theme = {}) {
  49. bottom: 3
  50. },
  51. today: {
  52. - backgroundColor: appStyle.todayBackgroundColor
  53. + backgroundColor: appStyle.todayBackgroundColor,
  54. + borderColor: '#ED9334',
  55. + borderWidth: 1,
  56. + borderRadius: 17
  57. },
  58. todayText: {
  59. fontWeight: '500',
  60. diff --git a/node_modules/react-native-calendars/src/calendar/index.js b/node_modules/react-native-calendars/src/calendar/index.js
  61. index 6f46e8a..de8ce86 100644
  62. --- a/node_modules/react-native-calendars/src/calendar/index.js
  63. +++ b/node_modules/react-native-calendars/src/calendar/index.js
  64. @@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
  65. import XDate from 'xdate';
  66. import isEmpty from 'lodash/isEmpty';
  67. import React, { useRef, useState, useEffect, useCallback, useMemo } from 'react';
  68. -import { View } from 'react-native';
  69. +import { View, PanResponder } from 'react-native';
  70. // @ts-expect-error
  71. import GestureRecognizer, { swipeDirections } from 'react-native-swipe-gestures';
  72. import constants from '../commons/constants';
  73. @@ -137,6 +137,11 @@ const Calendar = (props) => {
  74. }
  75. return false;
  76. }, [currentMonth, displayLoadingIndicator, markedDates]);
  77. + const panResponder = useRef(
  78. + PanResponder.create({
  79. + onStartShouldSetPanResponder: () => true,
  80. + })
  81. + ).current;
  82. const renderHeader = () => {
  83. const headerProps = extractHeaderProps(props);
  84. const ref = customHeader ? undefined : header;
  85. @@ -150,7 +155,7 @@ const Calendar = (props) => {
  86. };
  87. const gestureProps = enableSwipeMonths ? swipeProps : undefined;
  88. return (<GestureComponent {...gestureProps}>
  89. - <View style={[style.current.container, propsStyle]} testID={testID} accessibilityElementsHidden={accessibilityElementsHidden} // iOS
  90. + <View {...panResponder.panHandlers} style={[style.current.container, propsStyle]} testID={testID} accessibilityElementsHidden={accessibilityElementsHidden} // iOS
  91. importantForAccessibility={importantForAccessibility} // Android
  92. >
  93. {renderHeader()}