mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-26 01:43:59 +02:00
don't throw an exception if you wrote the wrong birthday instead log as an error.
This commit is contained in:
@@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package com.health.openscale.core;
|
package com.health.openscale.core;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -292,7 +294,7 @@ public class EvaluationSheet {
|
|||||||
|
|
||||||
birthDate.setTime(dateOfBirth);
|
birthDate.setTime(dateOfBirth);
|
||||||
if (birthDate.after(today)) {
|
if (birthDate.after(today)) {
|
||||||
throw new IllegalArgumentException("Can't be born in the future");
|
Log.e("EvaluationSheet", "Can't evaluate your body values because you can't be born in the future");
|
||||||
}
|
}
|
||||||
|
|
||||||
age = today.get(Calendar.YEAR) - birthDate.get(Calendar.YEAR);
|
age = today.get(Calendar.YEAR) - birthDate.get(Calendar.YEAR);
|
||||||
|
Reference in New Issue
Block a user