mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
fix code duplication
This commit is contained in:
@@ -130,7 +130,7 @@ public abstract class RepetitionList
|
||||
for (Repetition r : reps)
|
||||
{
|
||||
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);
|
||||
|
||||
long timestamp = date.getTimeInMillis();
|
||||
|
||||
@@ -206,7 +206,7 @@ public abstract class DateUtils
|
||||
public static int getWeekday(long timestamp)
|
||||
{
|
||||
GregorianCalendar day = getCalendar(timestamp);
|
||||
return day.get(DAY_OF_WEEK) % 7;
|
||||
return javaWeekdayToLoopWeekday(day.get(DAY_OF_WEEK));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user