-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [ANDROAPP-6644] Display correct style for scheduled overdue even…
…ts (#3896) * fix: [ANDROAPP-6644] check if scheduled event is overdue and test implementation * fix: [ANDROAPP-6644] manage icon for scheduled events correctly * fix: [ANDROAPP-6644] invoke onDateValue changed after sdk update request, set overdue correctly from repository * fix: [ANDROAPP-6644] resolve code smells * fix: [ANDROAPP-6644] correct test
- Loading branch information
1 parent
0be47dd
commit 732b459
Showing
10 changed files
with
88 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
commons/src/androidTest/java/org/dhis2/commons/date/DateUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.dhis2.commons.date; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
import org.junit.Test; | ||
import java.util.Calendar; | ||
import java.util.Date; | ||
|
||
public class DateUtilsTest { | ||
|
||
|
||
@Test | ||
public void returnsEventOverDueDateCorrectly() { | ||
|
||
Calendar calendar = Calendar.getInstance(); | ||
//should return false for current date | ||
calendar.setTime(new Date()); | ||
assertFalse(DateUtils.getInstance().isEventDueDateOverdue(calendar.getTime())); | ||
//false for future date | ||
calendar.add(Calendar.DAY_OF_MONTH, 10); | ||
assertFalse(DateUtils.getInstance().isEventDueDateOverdue(calendar.getTime())); | ||
//true for past dates | ||
calendar.add(Calendar.DAY_OF_MONTH, -30); | ||
assertTrue(DateUtils.getInstance().isEventDueDateOverdue(calendar.getTime())); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters