mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed an ISO8601 time parsing bug
This commit is contained in:
parent
a5c404a155
commit
60b4b7cfe5
1 changed files with 13 additions and 1 deletions
|
|
@ -506,7 +506,19 @@ Time Time::fromISO8601 (StringRef iso) noexcept
|
|||
if (minutes < 0)
|
||||
return {};
|
||||
|
||||
milliseconds = (int) (1000.0 * CharacterFunctions::readDoubleValue (t));
|
||||
auto seconds = parseFixedSizeIntAndSkip (t, 2, 0);
|
||||
if (seconds < 0)
|
||||
return {};
|
||||
|
||||
if (*t == '.')
|
||||
{
|
||||
++t;
|
||||
milliseconds = parseFixedSizeIntAndSkip (t, 3, 0);
|
||||
if (milliseconds < 0)
|
||||
return {};
|
||||
}
|
||||
|
||||
milliseconds += 1000 * seconds;
|
||||
}
|
||||
|
||||
const juce_wchar nextChar = t.getAndAdvance();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue