183
rated 0 times
[
184]
[
1]
/ answers: 1 / hits: 10655
/ 5 Years ago, sun, january 5, 2020, 12:00:00
In the project that I have, I used react-native-calendars library. Currently, I am able to get date by onPress. But the question is how to highlight that date. Logic: when the user presses the date it should be highlighted in whatever colour. The major reason is to distinguish the selected date from the rest of the dates. This is source code
This is a snippet of my code where which is responsible for getting the current date:
state={
selectedDate: '',
}
const getSelectedDayEvents = (date) => {
let serviceDate = moment(date);
serviceDate = serviceDate.format(DD.MM.YYYY);
this.setState({selectedDate: serviceDate});
};
More From » reactjs