pull/316/head^2
Alinson S. Xavier 8 years ago
parent a8aa6f192c
commit 57dc19550d

@ -203,7 +203,7 @@ public class FrequencyChart extends ScrollableChart
rect.set(0, 0, baseSize, baseSize);
rect.offset(prevRect.left, prevRect.top + baseSize * j);
int i = DateUtils.javaWeekdayToLoopWeekday(localeWeekdayList[j]);
int i = localeWeekdayList[j] % 7;
if (values != null) drawMarker(canvas, rect, values[i]);
rect.offset(0, rowHeight);

@ -34,7 +34,7 @@ public class CheckmarkListTest extends BaseUnitTest
{
private long dayLength;
private long today;
private Timestamp today;
private Habit nonDailyHabit;
@ -55,6 +55,7 @@ public class CheckmarkListTest extends BaseUnitTest
numericalHabit = fixtures.createNumericalHabit();
habitList.add(numericalHabit);
today = DateUtils.getToday();
}
@Test
@ -285,8 +286,8 @@ public class CheckmarkListTest extends BaseUnitTest
@Test
public void test_getValues_withValidInterval()
{
long from = today - 15 * dayLength;
long to = today - 5 * dayLength;
Timestamp from = today.minus(15);
Timestamp to = today.minus(5);
int[] expectedValues = {
CHECKED_EXPLICITLY,
@ -302,10 +303,7 @@ public class CheckmarkListTest extends BaseUnitTest
UNCHECKED
};
int[] actualValues = nonDailyHabit
.getCheckmarks()
.getValues(new Timestamp(from), new Timestamp(to));
int[] actualValues = nonDailyHabit.getCheckmarks().getValues(from, to);
assertThat(actualValues, equalTo(expectedValues));
}

@ -152,7 +152,7 @@ public class ListHabitsBehaviorTest extends BaseUnitTest
@Test
public void testOnStartup_firstLaunch()
{
long today = DateUtils.getStartOfToday();
Timestamp today = DateUtils.getToday();
when(prefs.isFirstRun()).thenReturn(true);
behavior.onStartup();

@ -20,6 +20,7 @@
package org.isoron.uhabits.core.utils;
import org.isoron.uhabits.core.*;
import org.isoron.uhabits.core.models.*;
import org.junit.*;
import java.util.*;
@ -34,7 +35,7 @@ public class DateUtilsTest extends BaseUnitTest
public void testFormatHeaderDate()
{
long timestamp = timestamp(2015, DECEMBER, 31);
GregorianCalendar date = DateUtils.getCalendar(timestamp);
GregorianCalendar date = new Timestamp(timestamp).toCalendar();
String formatted = DateUtils.formatHeaderDate(date);
assertThat(formatted, equalTo("Thu\n31"));
}

Loading…
Cancel
Save