|
@@ -21,12 +21,13 @@
|
|
|
#include "error.h"
|
|
|
#include "error_func.h"
|
|
|
#include "strings_func.h"
|
|
|
#include "rev.h"
|
|
|
#include "core/endian_func.hpp"
|
|
|
#include "date_func.h"
|
|
|
#include "timer/timer_game_calendar.h"
|
|
|
#include "vehicle_base.h"
|
|
|
#include "engine_base.h"
|
|
|
#include "language.h"
|
|
|
#include "townname_func.h"
|
|
|
#include "string_func.h"
|
|
|
#include "company_base.h"
|
|
@@ -421,33 +422,33 @@ static char *FormatBytes(char *buff, int
|
|
|
assert(id < lengthof(iec_prefixes));
|
|
|
buff += seprintf(buff, last, NBSP "%sB", iec_prefixes[id]);
|
|
|
|
|
|
return buff;
|
|
|
}
|
|
|
|
|
|
static char *FormatYmdString(char *buff, Date date, const char *last, uint case_index)
|
|
|
static char *FormatYmdString(char *buff, TimerGameCalendar::Date date, const char *last, uint case_index)
|
|
|
{
|
|
|
YearMonthDay ymd;
|
|
|
ConvertDateToYMD(date, &ymd);
|
|
|
|
|
|
int64 args[] = {ymd.day + STR_DAY_NUMBER_1ST - 1, STR_MONTH_ABBREV_JAN + ymd.month, ymd.year};
|
|
|
StringParameters tmp_params(args);
|
|
|
return FormatString(buff, GetStringPtr(STR_FORMAT_DATE_LONG), &tmp_params, last, case_index);
|
|
|
}
|
|
|
|
|
|
static char *FormatMonthAndYear(char *buff, Date date, const char *last, uint case_index)
|
|
|
static char *FormatMonthAndYear(char *buff, TimerGameCalendar::Date date, const char *last, uint case_index)
|
|
|
{
|
|
|
YearMonthDay ymd;
|
|
|
ConvertDateToYMD(date, &ymd);
|
|
|
|
|
|
int64 args[] = {STR_MONTH_JAN + ymd.month, ymd.year};
|
|
|
StringParameters tmp_params(args);
|
|
|
return FormatString(buff, GetStringPtr(STR_FORMAT_DATE_SHORT), &tmp_params, last, case_index);
|
|
|
}
|
|
|
|
|
|
static char *FormatTinyOrISODate(char *buff, Date date, StringID str, const char *last)
|
|
|
static char *FormatTinyOrISODate(char *buff, TimerGameCalendar::Date date, StringID str, const char *last)
|
|
|
{
|
|
|
YearMonthDay ymd;
|
|
|
ConvertDateToYMD(date, &ymd);
|
|
|
|
|
|
/* Day and month are zero-padded with ZEROFILL_NUM, hence the two 2s. */
|
|
|
int64 args[] = {ymd.day, 2, ymd.month + 1, 2, ymd.year};
|