Skip to content

Commit 3219991

Browse files
author
Jens Claes
committed
Possible fix voor #54
I fixed an issue with going to the next day. It doesn't seem to be related to getFirstVisibleDay but to goToDate. Not sure if it fixes the original issue.
1 parent 9f9b25b commit 3219991

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/src/main/java/com/alamkanak/weekview/WeekView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,8 @@ public void goToDate(Calendar date) {
13591359
today.set(Calendar.SECOND, 0);
13601360
today.set(Calendar.MILLISECOND, 0);
13611361

1362-
int dateDifference = (int) ((date.getTimeInMillis() - today.getTimeInMillis()) / (1000 * 60 * 60 * 24));
1362+
long day = 1000L * 60L * 60L * 24L;
1363+
long dateDifference = (date.getTimeInMillis()/day) - (today.getTimeInMillis()/day);
13631364
mCurrentOrigin.x = - dateDifference * (mWidthPerDay + mColumnGap);
13641365

13651366
invalidate();

0 commit comments

Comments
 (0)