Skip to content

Commit 44f2598

Browse files
committed
Adds toMidnight util method
1 parent abeadc7 commit 44f2598

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/javarosa/xform/util/CalendarUtils.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,4 +432,12 @@ public static String[] getMonthsArray(String key){
432432
public static void setArrayDataSource(ArrayDataSource arrayDataSource) {
433433
CalendarUtils.arrayDataSource = arrayDataSource;
434434
}
435+
436+
public static void toMidnight(Calendar cal) {
437+
cal.set(Calendar.HOUR_OF_DAY, 0);
438+
cal.set(Calendar.MINUTE, 0);
439+
cal.set(Calendar.SECOND, 0);
440+
cal.set(Calendar.MILLISECOND, 0);
441+
}
442+
435443
}

0 commit comments

Comments
 (0)