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) {
49
49
50
50
// Set long press listener for events.
51
51
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 );
52
56
}
53
57
54
58
@@ -125,12 +129,12 @@ public String interpretDate(Calendar date) {
125
129
// Details: http://stackoverflow.com/questions/16959502/get-one-letter-abbreviation-of-week-day-of-a-date-in-java#answer-16959657
126
130
if (shortDate )
127
131
weekday = String .valueOf (weekday .charAt (0 ));
128
- return weekday + format .format (date .getTime ());
132
+ return weekday . toUpperCase () + format .format (date .getTime ());
129
133
}
130
134
131
135
@ Override
132
136
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" ) ;
134
138
}
135
139
});
136
140
}
You can’t perform that action at this time.
0 commit comments