1
0
Fork 0
forked from len0rd/rockbox

Fix for time/date setting after power loss (battery change).

After a power loss, the time in the setting screen is set to 00:00 01/01/2003.
Fixes Bug report #715081, #741391, #742672


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3700 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Markus Braun 2003-05-27 14:28:08 +00:00
parent 9c76ee92aa
commit 44ee2ab577
2 changed files with 27 additions and 7 deletions

View file

@ -1707,10 +1707,6 @@ bool set_time(char* string, int timedate[])
while ( !done ) {
/* calculate the number of days in febuary */
realyear = timedate[3] + 2000;
if(realyear > 2030)
realyear = 2003; /* yeah, I believe this is now */
if((realyear % 4 == 0 && !(realyear % 100 == 0)) || realyear % 400 == 0)
daysinmonth[1] = 29;
else
@ -1765,8 +1761,8 @@ bool set_time(char* string, int timedate[])
lcd_getstringsize(buffer, &width, &prev_line_height);
snprintf(buffer, sizeof(buffer), "%s %04d %s %02d ",
str(dayname[timedate[6]]), realyear,
snprintf(buffer, sizeof(buffer), "%s 20%02d %s %02d ",
str(dayname[timedate[6]]), timedate[3],
str(monthname[timedate[4] - 1]), timedate[5]);
lcd_puts(0, 2, buffer);