I'm trying to turn a String into LocalDate
using this code:
String end = sharedPref.getString("endDate", "Not available");
DateTimeFormatter formatter = new DateTimeFormatter("yyyy-MM-dd");
LocalDate endDate = LocalDate.parse(end, formatter);
But it shows the error mentioned in the title. How do I fix it? If there's a better way I'm open to suggestions