1

I need a calendar in my project, but the buttons on it are invisible. I have tried reinstalling it and other things like changing the style.xml in the calendars android folder nothing works...

import DateTimePicker from "@react-native-community/datetimepicker";
{
  showCalendar && (
    <DateTimePicker
      testID="dateTimePicker"
      value={date}
      mode={"date"}
      is24Hour={false}
      display="calendar"
      onChange={setDateHandler}
    />
  );
}

There isn't much code that I could've written wrong, the showCalendar state and setDateHandler work, so I've excluded them. Here are some maybe relevant things from package.json:

"@react-native-community/datetimepicker": "^5.0.1", "expo": "~43.0.2", "react-native": "0.64.3",

Thanks in advance.

keikai
  • 14,085
  • 9
  • 49
  • 68
  • Which buttons you are talking about? 1. Used to open calendar? 2. Select date? 3. Ok/Cancel? – Akshay Feb 03 '22 at 08:12
  • @Akshay My bad I forgot to add pictures... [pic1](https://ibb.co/1RcPg0j) [pic2](https://ibb.co/f0LVBYp) [pic3](https://ibb.co/FJSs4bN) The Ok Cancel buttons are the problem – Nemanja Mitric Feb 03 '22 at 08:56

1 Answers1

2

The problem was that the display prop was set to display="calendar", when it should've been set to display="default". Thanks to @Akshay for answering quickly.

  • Good to hear that you have got expected results. Even you can change default header, selected date and buttons colours. If you need that, let me know. – Akshay Feb 04 '22 at 09:21