Fix report months form alphabetic to date order

parent 66e6001f
......@@ -62,9 +62,9 @@ reports/translations-worklog.md: combined-worklogs.sqlite combined-daylog.sqlite
now=$$(LANG=en_US date +%c)
ver=$(call versioninfo,$(PROJECT))
export IFS='|'
sqlite3 $< "SELECT DISTINCT(author) FROM commits" |
sqlite3 $< "SELECT DISTINCT(author) as Author FROM commits ORDER BY Author" |
while read author; do
sqlite3 $< "SELECT DISTINCT strftime('%Y-%m', date) FROM commits WHERE author='$${author}'" |
sqlite3 $< "SELECT DISTINCT strftime('%Y-%m', date) AS Month FROM commits WHERE author='$${author}' ORDER BY Month" |
while read month; do
sqlite3 combined-worklogs.sqlite "SELECT SUM(added+ -removed) FROM commits WHERE author='$${author}' and strftime('%Y-%m', date)='$${month}'" | read netadded
sqlite3 combined-daylog.sqlite "SELECT COUNT(DISTINCT(date)) AS Days FROM days WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' AND apr != '' AND hours >= 1" | read days
......@@ -80,7 +80,7 @@ reports/translations-worklog.md: combined-worklogs.sqlite combined-daylog.sqlite
echo
echo '``` table'
echo '---\nheader: True\n---'
sqlite3 --header -csv combined-worklogs.sqlite "SELECT file as Filename, SUM(added) AS Added, SUM(-removed) AS Removed FROM commits WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' GROUP BY Filename"
sqlite3 --header -csv combined-worklogs.sqlite "SELECT file as Filename, SUM(added) AS Added, SUM(-removed) AS Removed FROM commits WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' GROUP BY Filename ORDER BY Filename"
echo '```'
echo
if [[ $${days} -gt 0 ]]; then
......@@ -90,7 +90,7 @@ reports/translations-worklog.md: combined-worklogs.sqlite combined-daylog.sqlite
echo
echo '``` table'
echo '---\nheader: True\n---'
sqlite3 --header -csv combined-daylog.sqlite "SELECT date AS Date, SUM(hours) AS Hours FROM days WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' AND apr != '' AND Hours >= 1 GROUP BY date"
sqlite3 --header -csv combined-daylog.sqlite "SELECT date AS Date, SUM(hours) AS Hours FROM days WHERE author='$${author}' AND strftime('%Y-%m', date)='$${month}' AND apr != '' AND Hours >= 1 GROUP BY date ORDER BY Date"
echo '```'
echo
fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment