by Patryk27 · 1y ago · 0 comments
You're right, thanks - fixed! Small typos like those are the hill I'll die on.
> But I would expect curr.last_of_month().tomorrow().unwrap(), to return 2018-03-01 ???
This case actually matches the `Ordering::Less` branch (14 < 31), so it hits this arm:
Ordering::Less => curr + Span::new().days(day - curr.day()),
... yielding this calculation: 2018-02-14 + (31 - 14) = 2018-03-03
Since the actual next occurrence is on 2018-03-31, 2018-03-03 is a valid guess (just a suboptimal one).I've rephrased this section in the article to show the calculation more clearly now.
No comments yet.