mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-20 18:42:41 -05:00
add 2 new tags which display the hour in 12 or 24 hour format depending on the config setting.
%cf is for padded hour %cg is for just the number git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15826 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7034237dbb
commit
0ade09bd6b
3 changed files with 21 additions and 1 deletions
|
|
@ -767,8 +767,24 @@ static char *get_token_value(struct gui_wps *gwps,
|
||||||
limit = *intval;
|
limit = *intval;
|
||||||
*intval = -1;
|
*intval = -1;
|
||||||
}
|
}
|
||||||
|
#if CONFIG_RTC
|
||||||
|
int new_token = token->type;
|
||||||
|
if (token->type == WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED)
|
||||||
|
{
|
||||||
|
new_token = global_settings.timeformat == 0?
|
||||||
|
WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED:
|
||||||
|
WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED;
|
||||||
|
}
|
||||||
|
else if (token->type == WPS_TOKEN_RTC_HOUR_CFG)
|
||||||
|
{
|
||||||
|
new_token = global_settings.timeformat == 0?
|
||||||
|
WPS_TOKEN_RTC_HOUR_24:
|
||||||
|
WPS_TOKEN_RTC_HOUR_12;
|
||||||
|
}
|
||||||
|
switch (new_token)
|
||||||
|
#else
|
||||||
switch (token->type)
|
switch (token->type)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
case WPS_TOKEN_CHARACTER:
|
case WPS_TOKEN_CHARACTER:
|
||||||
return &(token->value.c);
|
return &(token->value.c);
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,8 @@ enum wps_token_type {
|
||||||
|
|
||||||
WPS_TOKEN_RTC_DAY_OF_MONTH,
|
WPS_TOKEN_RTC_DAY_OF_MONTH,
|
||||||
WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,
|
WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,
|
||||||
|
WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED,
|
||||||
|
WPS_TOKEN_RTC_HOUR_CFG,
|
||||||
WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED,
|
WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED,
|
||||||
WPS_TOKEN_RTC_HOUR_24,
|
WPS_TOKEN_RTC_HOUR_24,
|
||||||
WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED,
|
WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED,
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,8 @@ static const struct wps_tag all_tags[] = {
|
||||||
|
|
||||||
{ WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL },
|
{ WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL },
|
||||||
{ WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_RTC_REFRESH, NULL },
|
{ WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_RTC_REFRESH, NULL },
|
||||||
|
{ WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED, "cf", WPS_RTC_REFRESH, NULL },
|
||||||
|
{ WPS_TOKEN_RTC_HOUR_CFG, "cg", WPS_RTC_REFRESH, NULL },
|
||||||
{ WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", WPS_RTC_REFRESH, NULL },
|
{ WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", WPS_RTC_REFRESH, NULL },
|
||||||
{ WPS_TOKEN_RTC_HOUR_24, "ck", WPS_RTC_REFRESH, NULL },
|
{ WPS_TOKEN_RTC_HOUR_24, "ck", WPS_RTC_REFRESH, NULL },
|
||||||
{ WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", WPS_RTC_REFRESH, NULL },
|
{ WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", WPS_RTC_REFRESH, NULL },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue