I do not know what I am doing wrong? But what I am trying to do is format my dateDue
String from SharedPreferences
to the format of MM/dd/yyyy from MMddyyyy.
But my code below returns all dates with slashes but it displays the date 12/31/1969 and not my SharedPreferences number, which should display 12/30/2022. Why would it go back so far? Does it have to do with something with Calendar?
String myFormat = "MM/dd/yyyy";
SimpleDateFormat format = new SimpleDateFormat(myFormat);
SharedPreferences settings = context.getApplicationContext().getSharedPreferences(name, 0);
Integer dateDue = Integer.valueOf(settings.getInt("dateDue", 0));
format = new SimpleDateFormat(myFormat);
String date = format.format(dateDue);
if (Integer.valueOf(String.valueOf(dueAmount)) > 0) {
holder.getDateDue.setText(String.valueOf(date));
}