Skip to content
Snippets Groups Projects
Commit 04ae8ff0 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix U.S. system timezone reverting to Atlantic when the DAYLIGHT flag was set

... integer sign extension at fault here.

Also, add examples to Numeric vs. Verbal short date selection dialog.
Update some related help text.
parent 97cfb894
No related branches found
No related tags found
No related merge requests found
Pipeline #6997 passed
...@@ -214,7 +214,7 @@ int edit_sys_timezone(int page, int total) ...@@ -214,7 +214,7 @@ int edit_sys_timezone(int page, int total)
strcpy(opt[i++],"Hawaii/Alaska"); strcpy(opt[i++],"Hawaii/Alaska");
strcpy(opt[i++],"Bering"); strcpy(opt[i++],"Bering");
opt[i][0]=0; opt[i][0]=0;
switch(cfg.sys_timezone) { switch(((uint16_t)cfg.sys_timezone) & ~DAYLIGHT) {
default: default:
case AST: i = 0; break; case AST: i = 0; break;
case EST: i = 1; break; case EST: i = 1; break;
...@@ -1331,8 +1331,8 @@ int edit_sys_datefmt(int page, int total) ...@@ -1331,8 +1331,8 @@ int edit_sys_datefmt(int page, int total)
uifc.helpbuf= uifc.helpbuf=
"`Numeric Date Format:`\n" "`Numeric Date Format:`\n"
"\n" "\n"
"If you would like abbreviated dates to be displayed in the traditional\n" "If you would like short dates to be displayed in the traditional U.S.\n"
"U.S. date format of month first, choose `MM/DD/YY`. If you prefer the\n" "date format of month first, choose `MM/DD/YY`. If you prefer the\n"
"European traditional date format of day first, choose `DD/MM/YY`.\n" "European traditional date format of day first, choose `DD/MM/YY`.\n"
"If you and your users would prefer year first, choose `YY/MM/DD`.\n" "If you and your users would prefer year first, choose `YY/MM/DD`.\n"
"\n" "\n"
...@@ -1363,13 +1363,14 @@ int edit_sys_date_verbal(int page, int total) ...@@ -1363,13 +1363,14 @@ int edit_sys_date_verbal(int page, int total)
{ {
int mode = WIN_SAV | WIN_MID; int mode = WIN_SAV | WIN_MID;
int i = cfg.sys_date_verbal; int i = cfg.sys_date_verbal;
char* opts[] = { time_t t = time(NULL);
"Numeric", "Verbal", snprintf(opt[0],MAX_OPLN,"Numeric (e.g. %s)", unixtodstr(&cfg, (time32_t)t, tmp));
NULL }; snprintf(opt[1],MAX_OPLN,"Verbal (e.g. %s)", verbal_datestr(&cfg, (time32_t)t, tmp));
opt[2][0] = '\0';
uifc.helpbuf= uifc.helpbuf=
"`Short Date Display Format:`\n" "`Short Date Display Format:`\n"
"\n" "\n"
"If you would like abbreviated dates to be displayed using verbal\n" "If you would like short (8 character) dates to be displayed using verbal\n"
"(non-numeric, less ambiguous) month name abbreviations, choose `Verbal`."; "(non-numeric, less ambiguous) month name abbreviations, choose `Verbal`.";
; ;
if(page) { if(page) {
...@@ -1378,7 +1379,7 @@ int edit_sys_date_verbal(int page, int total) ...@@ -1378,7 +1379,7 @@ int edit_sys_date_verbal(int page, int total)
uifc.list_height = 2; uifc.list_height = 2;
} }
i=uifc.list(mode, 0, 11, 0,&i,0 i=uifc.list(mode, 0, 11, 0,&i,0
,"Short Date Display Format", opts); ,"Short Date Display Format", opt);
if (i < 0) if (i < 0)
return i; return i;
cfg.sys_date_verbal = i; cfg.sys_date_verbal = i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment