Skip to content

Commit

Permalink
fixed files form Time #20
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent d77a484 commit cc29def
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2539,12 +2539,18 @@ public int estimateParsedLength() {

public int parseInto(DateTimeParserBucket bucket, String text, int position) {
String str = text.substring(position);
String best = null;
for (String id : ALL_IDS) {
if (str.startsWith(id)) {
bucket.setZone(DateTimeZone.forID(id));
return position + id.length();
if (best == null || id.length() > best.length()) {
best = id;
}
}
}
if (best != null) {
bucket.setZone(DateTimeZone.forID(best));
return position + best.length();
}
return ~position;
}
}
Expand Down

0 comments on commit cc29def

Please sign in to comment.