Skip to content

Commit

Permalink
Update version
Browse files Browse the repository at this point in the history
  • Loading branch information
billthefarmer committed Dec 9, 2019
1 parent f2b0133 commit b251070
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ android {
applicationId "org.billthefarmer.diary"
minSdkVersion 14
targetSdkVersion 28
versionName "1.59"
versionCode 159
versionName "1.60"
versionCode 160

buildConfigField "long", "BUILT", System.currentTimeMillis() + "L"
}
Expand Down
15 changes: 4 additions & 11 deletions src/main/java/org/billthefarmer/diary/Diary.java
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,6 @@ private static CharSequence read(File file)
return null;
}

// setToMidnight
private static void setToMidnight(Calendar calendar)
{
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
}

// parseTime
private static long parseTime(File file)
{
Expand Down Expand Up @@ -2114,8 +2105,10 @@ private void setDate(Calendar date)
int month = date.get(Calendar.MONTH);
int day = date.get(Calendar.DATE);

Calendar today = Calendar.getInstance();
setToMidnight(today);
Calendar calendar = Calendar.getInstance();
Calendar today = new GregorianCalendar(calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),
calendar.get(Calendar.DATE));

prevEntry = getPrevEntry(year, month, day);
if ((prevEntry == null || today.compareTo(prevEntry) > 0) &&
Expand Down

0 comments on commit b251070

Please sign in to comment.