pohsiu/react-native-date-ranges

Question: Cancel button?

bvelasquez opened this issue · 3 comments

Is there a way to add a cancel button to the date selection? Currently, if the user does not select a date range, they just get an error.

Thank you!

I'm also interested in this!

Yes it seems this important feature is missing.

This is how you close the modal with out selecting input.
Add a ref to the component and access the setModalVisible

 customButton={(onConfirm) => (
          <View style={{ flex: 1, marginHorizontal: 20, marginTop: -30 }}>
            <Button
              variant={'primary'}
              buttonText="Select Range"
              textColor={theme.primarySurface}
              onPress={onConfirm}
            />
            <Button
              variant={'transparent'}
              buttonText="Cancel"
              textColor={theme.primaryColor}
              onPress={() => ref.current.setModalVisible(false)}
            />
          </View>
        )}
      />