maggialejandro/react-native-calendario

Feature request: Add inverted prop to start Calendar at the bottom

Closed this issue ยท 2 comments

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

I needed a way to start the calendar at the bottom as I am working with dates in the past. This diff allows the Calendar component to start rendered at the bottom.

I reckon passing an inverted prop to ` would be an awesome way to quickly flip the scroll direction.

I am happy to make a PR if you are happy with this feature request.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-calendario/src/components/Calendar.tsx b/node_modules/react-native-calendario/src/components/Calendar.tsx
index 8c9f27a..68b698c 100644
--- a/node_modules/react-native-calendario/src/components/Calendar.tsx
+++ b/node_modules/react-native-calendario/src/components/Calendar.tsx
@@ -222,6 +222,8 @@ const Calendar = forwardRef((props: CalendarProps, ref: Ref<FlatList>) => {
       renderItem={renderMonth}
       data={months}
       ref={ref}
+      inverted
+      contentContainerStyle={{ flexDirection: 'column-reverse' }}
     />
   );
 });
stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

stale commented

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.