PDA

View Full Version : CoreRPG Calendar Date Display Issue



mattekure
October 25th, 2021, 14:35
In the calendar code, there is a bug on displaying the date for the 11th, 12th, and 13th of each month. In the output text, the 11th is output as 11st, the 12th is output as 12nd, and the 13th is output as 13rd.

This can be replicated using a new CoreRPG campaign with no extensions loaded, and the standard gregorian calendar selected. Select any 11th, 12th, or 13th and output the date.

https://i.imgur.com/gTnaTkE.png


The reason for this is that the CalendarManager.getDateString() function is only using an (nDay % 10) to determine the last digit. This works for the 1st, 21st, and 31st of a month, but it does not work for the 11th.



local sSuffix = Interface.getString("message_calendardaysuffix" .. (nDay % 10));
local sDay = tostring(nDay) .. (sSuffix or "");

Moon Wizard
October 25th, 2021, 15:40
Thanks. I'll get that in the next beta push for CoreRPG in the Test channel.

Regards,
JPG