diff options
| author | Frank Gevaerts <frank@gevaerts.be> | 2009-08-11 19:30:19 +0000 |
|---|---|---|
| committer | Frank Gevaerts <frank@gevaerts.be> | 2009-08-11 19:30:19 +0000 |
| commit | 2dc50471ca17eaeb24b45abce4c0f8944cd781d5 (patch) | |
| tree | 3e704d88f999b8ab071f6ca7753c06e692486cbf /apps | |
| parent | eadfa483d1b014e39953669d79fb997d8cd1085d (diff) | |
| download | rockbox-2dc50471ca17eaeb24b45abce4c0f8944cd781d5.zip rockbox-2dc50471ca17eaeb24b45abce4c0f8944cd781d5.tar.gz rockbox-2dc50471ca17eaeb24b45abce4c0f8944cd781d5.tar.bz2 rockbox-2dc50471ca17eaeb24b45abce4c0f8944cd781d5.tar.xz | |
Consolidate day of week calculation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22258 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/screens.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/apps/screens.c b/apps/screens.c index 9f1596c..4ec35f9 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -511,7 +511,6 @@ bool set_time_screen(const char* title, struct tm *tm) int button; unsigned int i, j, s; int cursorpos = 0; - unsigned int julianday; unsigned int realyear; unsigned int width; unsigned int min, max; @@ -556,13 +555,7 @@ bool set_time_screen(const char* title, struct tm *tm) tm->tm_mday = daysinmonth[tm->tm_mon]; /* calculate day of week */ - julianday = tm->tm_mday; - for(i = 0; (int)i < tm->tm_mon; i++) { - julianday += daysinmonth[i]; - } - - tm->tm_wday = (realyear + julianday + (realyear - 1) / 4 - - (realyear - 1) / 100 + (realyear - 1) / 400 + 7 - 1) % 7; + set_day_of_week(tm); /* put all the numbers we want from the tm struct into an easily printable buffer */ |