▲ | Patryk27 3 months ago | |
> Shouldn't the nearest 12th day of the month after the 14th of January be 2018-02-12 ? 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:
... yielding this calculation:
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. |