KSP_Contract_Window icon indicating copy to clipboard operation
KSP_Contract_Window copied to clipboard

ContractsWindow+ doesn't show days to expire on RSS install

Open Gordon-Dry opened this issue 7 years ago • 1 comments

Only hours, minutes, seconds are shown.

The days are completely cut off: https://i.imgur.com/q8gpyKu.png

Gordon-Dry avatar Oct 12 '18 19:10 Gordon-Dry

We'll keep passing this along. 😜

I think this is a bug in RSSTimeFormatter.

The method it is using to print time seems to work backwards; instead of limiting the "depth" of the time value printed from the top, it goes from the bottom.

So instead of limiting a time to the top 3 values (342d, 10h, 5m), it's starting from the bottom (10h, 5m, 35s). This is backwards from how stock KSP works.

The relevant part of RSSTimeFormatter is: https://github.com/KSP-RO/RSSTimeFormatter/blob/master/RSSTimeFormatter/RealDateTimeFormatter.cs#L66-L92

Specifically, line 88 shows that when the "valuesOfInterest" value is 2 or lower, as it is for CW Plus, then it will only show up to the hours value.

At least as far as I can tell this seems to be the problem. The method in the DefaultDateTimeFormatter seems to be correct.

Is there a way to switch the time format used to see if the problem goes away? That would help isolate the issue.

DMagic1 avatar Oct 13 '18 00:10 DMagic1