File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
sample/src/main/java/com/alamkanak/weekview/sample Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ protected void onCreate(Bundle savedInstanceState) {
4949
5050 // Set long press listener for events.
5151 mWeekView .setEventLongPressListener (this );
52+
53+ // Set up a date time interpreter to interpret how the date and time will be formatted in
54+ // the week view. This is optional.
55+ setupDateTimeInterpreter (false );
5256 }
5357
5458
@@ -125,12 +129,12 @@ public String interpretDate(Calendar date) {
125129 // Details: http://stackoverflow.com/questions/16959502/get-one-letter-abbreviation-of-week-day-of-a-date-in-java#answer-16959657
126130 if (shortDate )
127131 weekday = String .valueOf (weekday .charAt (0 ));
128- return weekday + format .format (date .getTime ());
132+ return weekday . toUpperCase () + format .format (date .getTime ());
129133 }
130134
131135 @ Override
132136 public String interpretTime (int hour ) {
133- return hour > 11 ? (hour - 12 ) + "PM" : hour + "AM" ;
137+ return hour > 11 ? (hour - 12 ) + " PM" : ( hour == 0 ? "12 AM" : hour + " AM" ) ;
134138 }
135139 });
136140 }
You can’t perform that action at this time.
0 commit comments