diff options
Diffstat (limited to 'apps/screens.c')
-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 9f1596cb7a..4ec35f9f57 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -511,7 +511,6 @@ bool set_time_screen(const char* title, struct tm *tm) | |||
511 | int button; | 511 | int button; |
512 | unsigned int i, j, s; | 512 | unsigned int i, j, s; |
513 | int cursorpos = 0; | 513 | int cursorpos = 0; |
514 | unsigned int julianday; | ||
515 | unsigned int realyear; | 514 | unsigned int realyear; |
516 | unsigned int width; | 515 | unsigned int width; |
517 | unsigned int min, max; | 516 | unsigned int min, max; |
@@ -556,13 +555,7 @@ bool set_time_screen(const char* title, struct tm *tm) | |||
556 | tm->tm_mday = daysinmonth[tm->tm_mon]; | 555 | tm->tm_mday = daysinmonth[tm->tm_mon]; |
557 | 556 | ||
558 | /* calculate day of week */ | 557 | /* calculate day of week */ |
559 | julianday = tm->tm_mday; | 558 | set_day_of_week(tm); |
560 | for(i = 0; (int)i < tm->tm_mon; i++) { | ||
561 | julianday += daysinmonth[i]; | ||
562 | } | ||
563 | |||
564 | tm->tm_wday = (realyear + julianday + (realyear - 1) / 4 - | ||
565 | (realyear - 1) / 100 + (realyear - 1) / 400 + 7 - 1) % 7; | ||
566 | 559 | ||
567 | /* put all the numbers we want from the tm struct into | 560 | /* put all the numbers we want from the tm struct into |
568 | an easily printable buffer */ | 561 | an easily printable buffer */ |