Commit 86ec46a
Fix parsing of fractional durations (#13832)
The parsing of fractional durations checked for non-negativity by
testing second > 0, which reports false for not only negative integers
but also for 0.
Note that changing `if second > 0` to `if second >= 0` would fix
behaviour for "PT0,6S", but would break "PT-0,6S".1 parent c996318 commit 86ec46a
File tree
2 files changed
+14
-1
lines changed- lib/elixir
- lib/calendar
- test/elixir/calendar
2 files changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
718 | | - | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
719 | 727 | | |
720 | 728 | | |
721 | 729 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
240 | 241 | | |
241 | 242 | | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
265 | 270 | | |
266 | 271 | | |
267 | 272 | | |
| |||
0 commit comments