fix code duplication

pull/151/head
Denis 9 years ago
parent a527140802
commit 82d2931559

@ -130,7 +130,7 @@ public abstract class RepetitionList
for (Repetition r : reps) for (Repetition r : reps)
{ {
Calendar date = DateUtils.getCalendar(r.getTimestamp()); Calendar date = DateUtils.getCalendar(r.getTimestamp());
int weekday = date.get(Calendar.DAY_OF_WEEK) % 7; int weekday = DateUtils.getWeekday(r.getTimestamp());
date.set(Calendar.DAY_OF_MONTH, 1); date.set(Calendar.DAY_OF_MONTH, 1);
long timestamp = date.getTimeInMillis(); long timestamp = date.getTimeInMillis();

@ -206,7 +206,7 @@ public abstract class DateUtils
public static int getWeekday(long timestamp) public static int getWeekday(long timestamp)
{ {
GregorianCalendar day = getCalendar(timestamp); GregorianCalendar day = getCalendar(timestamp);
return day.get(DAY_OF_WEEK) % 7; return javaWeekdayToLoopWeekday(day.get(DAY_OF_WEEK));
} }
/** /**

Loading…
Cancel
Save