File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
library/src/main/java/com/alamkanak/weekview Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 21
21
import android .text .TextPaint ;
22
22
import android .text .TextUtils ;
23
23
import android .text .format .DateFormat ;
24
+ import android .text .format .DateUtils ;
24
25
import android .text .style .StyleSpan ;
25
26
import android .util .AttributeSet ;
26
27
import android .util .TypedValue ;
@@ -1302,8 +1303,10 @@ public DateTimeInterpreter getDateTimeInterpreter() {
1302
1303
@ Override
1303
1304
public String interpretDate (Calendar date ) {
1304
1305
try {
1305
- SimpleDateFormat sdf = mDayNameLength == LENGTH_SHORT ? new SimpleDateFormat ("EEEEE M/dd" , Locale .getDefault ()) : new SimpleDateFormat ("EEE M/dd" , Locale .getDefault ());
1306
- return sdf .format (date .getTime ()).toUpperCase ();
1306
+ int flags = DateUtils .FORMAT_SHOW_DATE | DateUtils .FORMAT_NO_YEAR | DateUtils .FORMAT_NUMERIC_DATE ;
1307
+ String localizedDate = DateUtils .formatDateTime (getContext (), date .getTime (), flags );
1308
+ SimpleDateFormat sdf = mDayNameLength == LENGTH_SHORT ? new SimpleDateFormat ("EEEEE" , Locale .getDefault ()) : new SimpleDateFormat ("EEE" , Locale .getDefault ());
1309
+ return String .format ("%s %s" , sdf .format (date .getTime ()).toUpperCase (), localizedDate );
1307
1310
} catch (Exception e ) {
1308
1311
e .printStackTrace ();
1309
1312
return "" ;
You can’t perform that action at this time.
0 commit comments