"os"
"strconv"
"strings"
+ "time"
"github.com/hjson/hjson-go"
"go.stargrave.org/sgblog"
`<th size="5%"><a title="Lines">L</a></th>` +
`<th size="5%"><a title="Comments">C</a></th>` +
"<th>Linked to</th></tr>\n")
+ var yearPrev int
+ var monthPrev time.Month
+ var dayPrev int
for _, entry := range entries {
+ yearCur, monthCur, dayCur := entry.commit.Author.When.Date()
+ if dayCur != dayPrev || monthCur != monthPrev || yearCur != yearPrev {
+ table.WriteString(fmt.Sprintf(
+ "<tr><td colspan=6><center><tt>%04d-%02d-%02d</tt></center></td></tr>\n",
+ yearCur, monthCur, dayCur,
+ ))
+ yearPrev, monthPrev, dayPrev = yearCur, monthCur, dayCur
+ }
commitN++
lines := msgSplit(entry.commit.Message)
domains := []string{}
commentsValue = " "
}
table.WriteString(fmt.Sprintf(
- "<tr><td>%d</td><td><tt>%s</tt></td>"+
+ "<tr><td>%d</td><td><tt>%02d:%02d</tt></td>"+
"<td>%s</td>"+
"<td>%d</td><td>%s</td>"+
"<td>%s</td></tr>\n",
- commitN, entry.commit.Author.When.Format(sgblog.WhenFmt),
+ commitN,
+ entry.commit.Author.When.Hour(),
+ entry.commit.Author.When.Minute(),
makeA(cfg.URLPrefix+"/"+entry.commit.Hash.String(), lines[0]),
len(lines)-2,
commentsValue,