Ivar found a strange bug where one of the ticks at a non-leap day boundary shows 23:59:61. To show this:
This also has another interesting bug, where saving the state to a .vap doesn't load properly. In fact, when the bug is showing, the command line shows:
AP> print dom.plots[0].xaxis.range
2012-11-10 23:59:51.905 to 2012-11-12 00:00:10.978
AP> print dom.plots[0].xaxis.range.width()
19.07 s
Here is a screenshot
Here is a script that demos the bug:
In TimeUtil.toTimeStruct, there's odd code for CDF_TT2000:
I think it's time to review it.
There are actually two bugs here. When it shows "2012-01-10T23:59:60.000Z" this is because of a rounding error, where it's not smart enough to roll over the seconds and minutes. When it shows "61" it's because it's entering the strange branch.
Last edit: Jeremy Faden 2018-02-07
The leap seconds part of this bug is fixed, by verifying that this could actually be a leap day.
I believe the 23:58:60 is fixed as well. It too was a cdfTT2000 problem, where it didn't properly move 60s to 1min because it could be a leap second. I made it so that the leap second would have to be on June/30 or Dec/31, which is more precise, though will fail twice a year.
Masafumi pointed out that this fix causes a new problem. This code demos:
There's a special branch now for Datums backed by longs, so that CDF_TT2000 can be precisely represented. See https://sourceforge.net/p/autoplot/bugs/2133/
I can't see the bug Ivar originally described (I guess that means I fixed it), but I do see where the midnight location is not used for the tag, with noise from roundoff. See image.
This seems to be fixed.