Skip to content

Commit

Permalink
factorise setting FORMAT_SHOW_WEEKDAY
Browse files Browse the repository at this point in the history
since it is set in all cases
  • Loading branch information
Lionel Mamane committed Oct 6, 2023
1 parent 93882ee commit 5bebfdc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,16 @@ private EventInfo populateEventInfo(long eventId, boolean allDay, long start, lo

private DayInfo populateDayInfo(int julianDay, Time recycle) {
long millis = recycle.setJulianDay(julianDay);
int flags = DateUtils.FORMAT_ABBREV_ALL | DateUtils.FORMAT_SHOW_DATE;
int flags =
DateUtils.FORMAT_ABBREV_ALL |
DateUtils.FORMAT_SHOW_DATE |
DateUtils.FORMAT_SHOW_WEEKDAY;

String label;
if (julianDay == mTodayJulianDay + 1) {
flags |= DateUtils.FORMAT_SHOW_WEEKDAY;
label = mContext.getString(R.string.agenda_tomorrow,
Utils.formatDateRange(mContext, millis, millis, flags));
} else {
flags |= DateUtils.FORMAT_SHOW_WEEKDAY;
label = Utils.formatDateRange(mContext, millis, millis, flags);
}
return new DayInfo(julianDay, label);
Expand Down

0 comments on commit 5bebfdc

Please sign in to comment.