summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-05-21 12:54:07 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-05-21 12:54:07 +0000
commit9d5e376fc37caae42816f5603fc480380574bce5 (patch)
tree04dea2d0a218a9e108853307dcc55f84e18faf70 /apps
parentbcdf43dbc12a90b81d0f6f5ba97ce50aa9641514 (diff)
downloadrockbox-9d5e376fc37caae42816f5603fc480380574bce5.tar.gz
rockbox-9d5e376fc37caae42816f5603fc480380574bce5.zip
Allow the day of month (%cm) and day of week (%cu and %cw) RTC tags to be used in enums.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13454 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/gwps-common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 9e5329bd4f..2429d74b86 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1106,6 +1106,8 @@ static char *get_token_value(struct gui_wps *gwps,
case WPS_TOKEN_RTC_MONTH:
/* m: month (01..12) */
+ if (intval)
+ *intval = tm->tm_mon + 1;
snprintf(buf, buf_size, "%02d", tm->tm_mon + 1);
return buf;
@@ -1151,11 +1153,15 @@ static char *get_token_value(struct gui_wps *gwps,
case WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON:
/* u: day of week (1..7); 1 is Monday */
+ if (intval)
+ *intval = (tm->tm_wday == 0) ? 7 : tm->tm_wday;
snprintf(buf, buf_size, "%1d", tm->tm_wday + 1);
return buf;
case WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN:
/* w: day of week (0..6); 0 is Sunday */
+ if (intval)
+ *intval = tm->tm_wday + 1;
snprintf(buf, buf_size, "%1d", tm->tm_wday);
return buf;
#endif