public static Date fromISO8601DateLoose( char[] buffer, int startIndex, int endIndex ) {
if ( Dates.isISO8601QuickCheck( buffer, startIndex, endIndex ) ) {
if ( Dates.isJsonDate( buffer, startIndex, endIndex ) ) {
return Dates.fromJsonDate( buffer, startIndex, endIndex );
} else if ( Dates.isISO8601( buffer, startIndex, endIndex ) ) {
return Dates.fromISO8601( buffer, startIndex, endIndex );
} else {
try {
return looseParse( buffer, startIndex, endIndex );
} catch ( Exception ex ) {
throw new IllegalStateException( "unable to do a loose parse", ex );
}
}
} else {
try {
return looseParse( buffer, startIndex, endIndex );
} catch ( Exception ex ) {
throw new IllegalStateException( "unable to do a loose parse", ex );
}
}
}