Bring extra-milliseconds fix to main

1. bring code from https://github.com/Ranchero-Software/RSParser/pull/78/files to main.
This commit is contained in:
zll600
2024-08-25 15:44:31 +08:00
parent 65a18129ca
commit 090c8e0247
2 changed files with 10 additions and 6 deletions

View File

@@ -389,6 +389,9 @@ static NSDate *RSParseW3CWithBytes(const char *bytes, NSUInteger numberOfBytes)
if (hasMilliseconds) {
milliseconds = nextNumericValue(bytes, numberOfBytes, currentIndex, 3, &finalIndex);
currentIndex = finalIndex + 1;
// Igore more than 3 digits for fraction of a second
while (currentIndex < numberOfBytes && isdigit(bytes[currentIndex])) currentIndex++;
}
timeZoneOffset = parsedTimeZoneOffset(bytes, numberOfBytes, currentIndex);