Fossil SCM
Fix the projected extra on the byday variant of /reports.
Commit
286f4fe5614c0daf1d4ab83d13f490be82afdd7bd3411e0528586b007d7363a9
Parent
c00b72f463f8a40…
1 file changed
+5
-5
+5
-5
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -898,11 +898,11 @@ | ||
| 898 | 898 | } |
| 899 | 899 | @ </h1> |
| 900 | 900 | zCurrentDay = db_text(0, "SELECT date()"); |
| 901 | 901 | if( zCurrentDay ){ |
| 902 | 902 | 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;"); | |
| 904 | 904 | } |
| 905 | 905 | style_table_sorter(); |
| 906 | 906 | cgi_printf("<table class='statistics-report-table-events sortable' " |
| 907 | 907 | "border='0' cellpadding='2' width='100%%' " |
| 908 | 908 | "cellspacing='0' data-column-types='tnx' data-init-sort='0'>\n"); |
| @@ -942,15 +942,15 @@ | ||
| 942 | 942 | && strcmp(zDate, zCurrentDay)==0 |
| 943 | 943 | && rNowFraction>0.05 |
| 944 | 944 | && nMaxEvents>0 |
| 945 | 945 | ){ |
| 946 | 946 | /* 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 | |
| 948 | 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; | |
| 949 | + int nProj = (int)(nCount/rNowFraction); | |
| 950 | + int nExtra = (int)(100.0*nCount/rNowFraction - 100*nCount); | |
| 951 | + int nXSize = nExtra/nMaxEvents; | |
| 952 | 952 | @ <span class='statistics-report-graph-line' \ |
| 953 | 953 | @ style='display:inline-block;min-width:%d(nSize)%%;'> </span>\ |
| 954 | 954 | @ <span class='statistics-report-graph-extra' title='%d(nProj)' \ |
| 955 | 955 | @ style='display:inline-block;min-width:%d(nXSize)%%;'> </span>\ |
| 956 | 956 | }else{ |
| 957 | 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'))/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)%%;'> </span>\ |
| 954 | @ <span class='statistics-report-graph-extra' title='%d(nProj)' \ |
| 955 | @ style='display:inline-block;min-width:%d(nXSize)%%;'> </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)%%;'> </span>\ |
| 954 | @ <span class='statistics-report-graph-extra' title='%d(nProj)' \ |
| 955 | @ style='display:inline-block;min-width:%d(nXSize)%%;'> </span>\ |
| 956 | }else{ |
| 957 |