`<View style={styles.dateInput}>
<Text style={styles.text}>To Date</Text>
<TouchableOpacity onPress={() => showDatePicker(false)}>
<TextInput
placeholder="Select Date"
value={toDate}
editable={false}
style={styles.dateinput}
/>
</TouchableOpacity>
</View>
<DateTimePickerModal
isVisible={isDatePickerVisible}
mode="date"
onConfirm={handleDateConfirm}
onCancel={hideDatePicker}
/>`
i want to display current date in place of "Select Date" in placeholder. i have a datepicker input for selcting the date.
2
Answers
You need a state for save toDate value.
And with dayjs. you can show it ez: