From 9d5e376fc37caae42816f5603fc480380574bce5 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Mon, 21 May 2007 12:54:07 +0000 Subject: 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 --- apps/gui/gwps-common.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apps/gui/gwps-common.c') 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 -- cgit v1.2.3