Commit 1f65a30
committed
Polyfill: Cap day span at <100% of day length in ZonedDateTime.round()
The assertion in the previous code was a problem in cases where a
backwards UTC shift spanned across midnight (i.e. from a time after
midnight to a time before midnight, not starting or ending at midnight.)
It would produce a span of startNs...thisNs that was longer than 100% of
the day length, which failed the assertion, but would also mess up
rounding modes (would expand to 200% of the day length, for example.)
See: #33121 parent 3b8337a commit 1f65a30
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
305 | 311 | | |
306 | 312 | | |
307 | 313 | | |
| |||
0 commit comments