Ref T10747. I'm porting unit tests from other implementations until I hit one that fails.
The "yearly event on Feb 29th" test failed because we assumed every month had a 29th. Instead, test if the current month has a 29th.
We were also using cursorX instead of stateX in a couple places. They often have the same value, but stateX is the correct value when they differ.