mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-15 21:07:30 -04:00
Progress on fixing tests
This commit is contained in:
@@ -6,6 +6,10 @@ import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
|
||||
public class Utils {
|
||||
@@ -61,4 +65,16 @@ public class Utils {
|
||||
|
||||
return new BarcodeValues(format, contents);
|
||||
}
|
||||
|
||||
static public Boolean hasExpired(Date expiryDate) {
|
||||
// today
|
||||
Calendar date = new GregorianCalendar();
|
||||
// reset hour, minutes, seconds and millis
|
||||
date.set(Calendar.HOUR_OF_DAY, 0);
|
||||
date.set(Calendar.MINUTE, 0);
|
||||
date.set(Calendar.SECOND, 0);
|
||||
date.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
return expiryDate.before(date.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user