|
|
@ -8,6 +8,7 @@ import { |
|
|
|
Platform, |
|
|
|
TouchableOpacity, |
|
|
|
} from "react-native"; |
|
|
|
import { FontAwesome5 } from "@expo/vector-icons"; |
|
|
|
import DateTimePicker from "@react-native-community/datetimepicker"; |
|
|
|
|
|
|
|
import moment from "moment"; |
|
|
@ -64,7 +65,16 @@ const FormDatePicker = (props) => { |
|
|
|
|
|
|
|
return ( |
|
|
|
<TouchableOpacity onPress={() => setShow(true)}> |
|
|
|
<View style={{ flex: 1, flexDirection: "row", alignItems: 'center', justifyContent: "space-between" }}> |
|
|
|
<View style={ styles.dateInput }> |
|
|
|
<Text> {date.format("DD/MM/YYYY")}</Text> |
|
|
|
</View> |
|
|
|
<FontAwesome5 |
|
|
|
name="calendar-day" |
|
|
|
size={30} |
|
|
|
color="grey" |
|
|
|
/> |
|
|
|
</View> |
|
|
|
{Platform.OS !== "ios" && show && renderDatePicker()} |
|
|
|
|
|
|
|
{Platform.OS === "ios" && show && ( |
|
|
@ -130,7 +140,7 @@ const FormDatePicker = (props) => { |
|
|
|
FormDatePicker.defaultProps = { |
|
|
|
textStyle: {}, |
|
|
|
defaultDate: moment(), |
|
|
|
onDateChange: () => {}, |
|
|
|
onDateChange: () => { }, |
|
|
|
}; |
|
|
|
|
|
|
|
const styles = StyleSheet.create({ |
|
|
@ -149,6 +159,13 @@ const styles = StyleSheet.create({ |
|
|
|
alignItems: "center", |
|
|
|
justifyContent: "center", |
|
|
|
}, |
|
|
|
dateInput: { |
|
|
|
flex: 0.97, |
|
|
|
backgroundColor: colors.light, |
|
|
|
borderRadius: 25, |
|
|
|
padding: 18, |
|
|
|
marginVertical: 10, |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
export default FormDatePicker; |