Fossil SCM
Allow the "localtime" modifier on date/time functions within ticket report SQL statements. Ticket [bf4f5725f6c90fc2]
Commit
8c3bba8e97a29c0416a397f9524656596e98802f
Parent
64a9c81a222733a…
2 files changed
+1
+1
+1
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -956,10 +956,11 @@ | ||
| 956 | 956 | output_color_key(zClrKey, 1, |
| 957 | 957 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 958 | 958 | @ <table border="1" cellpadding="2" cellspacing="0" class="report"> |
| 959 | 959 | sState.rn = rn; |
| 960 | 960 | sState.nCount = 0; |
| 961 | + (void)fossil_localtime(0); /* initialize the g.fTimeFormat variable */ | |
| 961 | 962 | sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1); |
| 962 | 963 | sqlite3_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2); |
| 963 | 964 | sqlite3_set_authorizer(g.db, 0, 0); |
| 964 | 965 | @ </table> |
| 965 | 966 | if( zErr1 ){ |
| 966 | 967 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -956,10 +956,11 @@ | |
| 956 | output_color_key(zClrKey, 1, |
| 957 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 958 | @ <table border="1" cellpadding="2" cellspacing="0" class="report"> |
| 959 | sState.rn = rn; |
| 960 | sState.nCount = 0; |
| 961 | sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1); |
| 962 | sqlite3_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2); |
| 963 | sqlite3_set_authorizer(g.db, 0, 0); |
| 964 | @ </table> |
| 965 | if( zErr1 ){ |
| 966 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -956,10 +956,11 @@ | |
| 956 | output_color_key(zClrKey, 1, |
| 957 | "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\""); |
| 958 | @ <table border="1" cellpadding="2" cellspacing="0" class="report"> |
| 959 | sState.rn = rn; |
| 960 | sState.nCount = 0; |
| 961 | (void)fossil_localtime(0); /* initialize the g.fTimeFormat variable */ |
| 962 | sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1); |
| 963 | sqlite3_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2); |
| 964 | sqlite3_set_authorizer(g.db, 0, 0); |
| 965 | @ </table> |
| 966 | if( zErr1 ){ |
| 967 |
+1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1247,10 +1247,11 @@ | ||
| 1247 | 1247 | g.fTimeFormat = 1; |
| 1248 | 1248 | }else{ |
| 1249 | 1249 | g.fTimeFormat = 2; |
| 1250 | 1250 | } |
| 1251 | 1251 | } |
| 1252 | + if( clock==0 ) return 0; | |
| 1252 | 1253 | if( g.fTimeFormat==1 ){ |
| 1253 | 1254 | return gmtime(clock); |
| 1254 | 1255 | }else{ |
| 1255 | 1256 | return localtime(clock); |
| 1256 | 1257 | } |
| 1257 | 1258 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1247,10 +1247,11 @@ | |
| 1247 | g.fTimeFormat = 1; |
| 1248 | }else{ |
| 1249 | g.fTimeFormat = 2; |
| 1250 | } |
| 1251 | } |
| 1252 | if( g.fTimeFormat==1 ){ |
| 1253 | return gmtime(clock); |
| 1254 | }else{ |
| 1255 | return localtime(clock); |
| 1256 | } |
| 1257 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1247,10 +1247,11 @@ | |
| 1247 | g.fTimeFormat = 1; |
| 1248 | }else{ |
| 1249 | g.fTimeFormat = 2; |
| 1250 | } |
| 1251 | } |
| 1252 | if( clock==0 ) return 0; |
| 1253 | if( g.fTimeFormat==1 ){ |
| 1254 | return gmtime(clock); |
| 1255 | }else{ |
| 1256 | return localtime(clock); |
| 1257 | } |
| 1258 |