diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2024-05-24 23:48:18 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2024-05-24 23:48:18 +0200 |
| commit | b945e3e708b41b456bec99b48c4b5aeab16ea53e (patch) | |
| tree | aee0aed3c0f480a6a6e081f0ceaec33cff58dc76 | |
| parent | 1473374bba629e4523ca99c2de00b38930431103 (diff) | |
Limit to max of 9 fraction second digits, part deux.
| -rw-r--r-- | core/time/iso8061.odin | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/time/iso8061.odin b/core/time/iso8061.odin index 1be88d769..528e0b00a 100644 --- a/core/time/iso8061.odin +++ b/core/time/iso8061.odin @@ -69,8 +69,8 @@ _iso8601_to_components :: proc(iso_datetime: string) -> (res: dt.DateTime, utc_o if iso_datetime[count] == '.' { count += 1 // consume '.' multiplier := 100_000_000 - for digit in iso_datetime[count:] && multiplier >= 1 { - if int(digit) >= '0' && int(digit) <= '9' { + for digit in iso_datetime[count:] { + if multiplier >= 1 && int(digit) >= '0' && int(digit) <= '9' { nanos += int(digit - '0') * multiplier multiplier /= 10 count += 1 |