Fossil SCM

Fix the projected extra on the byday variant of /reports.

drh 2026-07-01 14:06 UTC trunk
Commit 286f4fe5614c0daf1d4ab83d13f490be82afdd7bd3411e0528586b007d7363a9
1 file changed +5 -5
+5 -5
--- src/statrep.c
+++ src/statrep.c
@@ -898,11 +898,11 @@
898898
}
899899
@ </h1>
900900
zCurrentDay = db_text(0, "SELECT date()");
901901
if( zCurrentDay ){
902902
rNowFraction = db_double(0.5,
903
- "SELECT (unixepoch()-unixepoch('now','start of day'))/604800.0;");
903
+ "SELECT (unixepoch()-unixepoch('now','start of day'))/86400.0;");
904904
}
905905
style_table_sorter();
906906
cgi_printf("<table class='statistics-report-table-events sortable' "
907907
"border='0' cellpadding='2' width='100%%' "
908908
"cellspacing='0' data-column-types='tnx' data-init-sort='0'>\n");
@@ -942,15 +942,15 @@
942942
&& strcmp(zDate, zCurrentDay)==0
943943
&& rNowFraction>0.05
944944
&& nMaxEvents>0
945945
){
946946
/* If the timespan covered by this row contains "now", then project
947
- ** the number of changes until the completion of the week and
947
+ ** the number of changes until the completion of the day and
948948
** show a dashed box of that projection. */
949
- int nProj = (int)(((double)nCount)/rNowFraction);
950
- int nExtra = (int)(((double)nCount)/rNowFraction) - nCount;
951
- int nXSize = (100 * nExtra)/nMaxEvents;
949
+ int nProj = (int)(nCount/rNowFraction);
950
+ int nExtra = (int)(100.0*nCount/rNowFraction - 100*nCount);
951
+ int nXSize = nExtra/nMaxEvents;
952952
@ <span class='statistics-report-graph-line' \
953953
@ style='display:inline-block;min-width:%d(nSize)%%;'>&nbsp;</span>\
954954
@ <span class='statistics-report-graph-extra' title='%d(nProj)' \
955955
@ style='display:inline-block;min-width:%d(nXSize)%%;'>&nbsp;</span>\
956956
}else{
957957
--- src/statrep.c
+++ src/statrep.c
@@ -898,11 +898,11 @@
898 }
899 @ </h1>
900 zCurrentDay = db_text(0, "SELECT date()");
901 if( zCurrentDay ){
902 rNowFraction = db_double(0.5,
903 "SELECT (unixepoch()-unixepoch('now','start of day'))/604800.0;");
904 }
905 style_table_sorter();
906 cgi_printf("<table class='statistics-report-table-events sortable' "
907 "border='0' cellpadding='2' width='100%%' "
908 "cellspacing='0' data-column-types='tnx' data-init-sort='0'>\n");
@@ -942,15 +942,15 @@
942 && strcmp(zDate, zCurrentDay)==0
943 && rNowFraction>0.05
944 && nMaxEvents>0
945 ){
946 /* If the timespan covered by this row contains "now", then project
947 ** the number of changes until the completion of the week and
948 ** show a dashed box of that projection. */
949 int nProj = (int)(((double)nCount)/rNowFraction);
950 int nExtra = (int)(((double)nCount)/rNowFraction) - nCount;
951 int nXSize = (100 * nExtra)/nMaxEvents;
952 @ <span class='statistics-report-graph-line' \
953 @ style='display:inline-block;min-width:%d(nSize)%%;'>&nbsp;</span>\
954 @ <span class='statistics-report-graph-extra' title='%d(nProj)' \
955 @ style='display:inline-block;min-width:%d(nXSize)%%;'>&nbsp;</span>\
956 }else{
957
--- src/statrep.c
+++ src/statrep.c
@@ -898,11 +898,11 @@
898 }
899 @ </h1>
900 zCurrentDay = db_text(0, "SELECT date()");
901 if( zCurrentDay ){
902 rNowFraction = db_double(0.5,
903 "SELECT (unixepoch()-unixepoch('now','start of day'))/86400.0;");
904 }
905 style_table_sorter();
906 cgi_printf("<table class='statistics-report-table-events sortable' "
907 "border='0' cellpadding='2' width='100%%' "
908 "cellspacing='0' data-column-types='tnx' data-init-sort='0'>\n");
@@ -942,15 +942,15 @@
942 && strcmp(zDate, zCurrentDay)==0
943 && rNowFraction>0.05
944 && nMaxEvents>0
945 ){
946 /* If the timespan covered by this row contains "now", then project
947 ** the number of changes until the completion of the day and
948 ** show a dashed box of that projection. */
949 int nProj = (int)(nCount/rNowFraction);
950 int nExtra = (int)(100.0*nCount/rNowFraction - 100*nCount);
951 int nXSize = nExtra/nMaxEvents;
952 @ <span class='statistics-report-graph-line' \
953 @ style='display:inline-block;min-width:%d(nSize)%%;'>&nbsp;</span>\
954 @ <span class='statistics-report-graph-extra' title='%d(nProj)' \
955 @ style='display:inline-block;min-width:%d(nXSize)%%;'>&nbsp;</span>\
956 }else{
957

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button