minor cleanup
This commit is contained in:
parent
e967af2397
commit
ee3605428e
@ -39,14 +39,13 @@ public class Utils {
|
|||||||
|
|
||||||
final Calendar calendar = Calendar.getInstance();
|
final Calendar calendar = Calendar.getInstance();
|
||||||
final int currentYear = calendar.get(Calendar.YEAR);
|
final int currentYear = calendar.get(Calendar.YEAR);
|
||||||
int year;
|
|
||||||
|
|
||||||
// Year is required
|
// Year is required
|
||||||
String field = date.substring(position += 2, 6);
|
String field = date.substring(position += 2, 6);
|
||||||
if (!TextUtils.isDigitsOnly(field)) {
|
if (!TextUtils.isDigitsOnly(field)) {
|
||||||
throw new ParseException("Invalid year", position);
|
throw new ParseException("Invalid year", position);
|
||||||
}
|
}
|
||||||
year = Integer.parseInt(field);
|
int year = Integer.parseInt(field);
|
||||||
if (year > currentYear) {
|
if (year > currentYear) {
|
||||||
year = currentYear;
|
year = currentYear;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user