mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-23 02:41:58 -05:00
Add an additional check for locales that do not use leading zeros for dates.
This commit is contained in:
parent
484956e006
commit
56216fd026
1 changed files with 11 additions and 0 deletions
|
@ -651,9 +651,20 @@ static void window_loadsave_compute_max_date_width()
|
|||
|
||||
std::time_t long_time = mktime(&tm);
|
||||
|
||||
// Check how how this date is represented (e.g. 2000-02-20, or 00/02/20)
|
||||
std::string date = Platform::FormatShortDate(long_time);
|
||||
maxDateWidth = gfx_get_string_width(date.c_str());
|
||||
|
||||
// Some locales do not use leading zeros for months and days, so let's try October, too.
|
||||
tm.tm_mon = 10;
|
||||
tm.tm_yday = 294;
|
||||
long_time = mktime(&tm);
|
||||
|
||||
// Again, check how how this date is represented (e.g. 2000-10-20, or 00/10/20)
|
||||
date = Platform::FormatShortDate(long_time);
|
||||
maxDateWidth = std::max(maxDateWidth, gfx_get_string_width(date.c_str()));
|
||||
|
||||
// Time appears to be universally represented with two digits for minutes, so 12:00 or 00:00 should be representable.
|
||||
std::string time = Platform::FormatTime(long_time);
|
||||
maxTimeWidth = gfx_get_string_width(time.c_str());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue