1096 |
// exactly 2 digits. |
// exactly 2 digits. |
1097 |
int digit_count = pos.getIndex() - index; |
int digit_count = pos.getIndex() - index; |
1098 |
if (digit_count == 2) |
if (digit_count == 2) |
1099 |
is2DigitYear = true; |
{ |
1100 |
|
is2DigitYear = true; |
1101 |
|
value += defaultCentury; |
1102 |
|
} |
1103 |
} |
} |
1104 |
|
|
1105 |
// Assign the value and move on. |
// Assign the value and move on. |
1110 |
{ |
{ |
1111 |
// Apply the 80-20 heuristic to dermine the full year based on |
// Apply the 80-20 heuristic to dermine the full year based on |
1112 |
// defaultCenturyStart. |
// defaultCenturyStart. |
1113 |
int year = defaultCentury + calendar.get(Calendar.YEAR); |
int year = calendar.get(Calendar.YEAR); |
|
calendar.set(Calendar.YEAR, year); |
|
1114 |
if (calendar.getTime().compareTo(defaultCenturyStart) < 0) |
if (calendar.getTime().compareTo(defaultCenturyStart) < 0) |
1115 |
calendar.set(Calendar.YEAR, year + 100); |
calendar.set(Calendar.YEAR, year + 100); |
1116 |
} |
} |