Skip to content

Commit

Permalink
Fix date interpreter in the sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
alamkanak committed May 9, 2015
1 parent 415bc79 commit 39fd130
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -49,6 +49,10 @@ protected void onCreate(Bundle savedInstanceState) {

// Set long press listener for events.
mWeekView.setEventLongPressListener(this);

// Set up a date time interpreter to interpret how the date and time will be formatted in
// the week view. This is optional.
setupDateTimeInterpreter(false);
}


@@ -125,12 +129,12 @@ public String interpretDate(Calendar date) {
// Details: http://stackoverflow.com/questions/16959502/get-one-letter-abbreviation-of-week-day-of-a-date-in-java#answer-16959657
if (shortDate)
weekday = String.valueOf(weekday.charAt(0));
return weekday + format.format(date.getTime());
return weekday.toUpperCase() + format.format(date.getTime());
}

@Override
public String interpretTime(int hour) {
return hour > 11 ? (hour - 12) + "PM" : hour + "AM";
return hour > 11 ? (hour - 12) + " PM" : (hour == 0 ? "12 AM" : hour + " AM");
}
});
}

0 comments on commit 39fd130

Please sign in to comment.