mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-01-19 07:02:51 +00:00
Display proper time on history pages
This commit is contained in:
parent
ff875ceb1a
commit
e5c96eee88
@ -146,13 +146,14 @@ func (rev *Revision) asHistoryEntry(hyphaName string) (html string) {
|
|||||||
<span class="history-entry__msg">%[4]s</span>
|
<span class="history-entry__msg">%[4]s</span>
|
||||||
</a>%[5]s
|
</a>%[5]s
|
||||||
</li>
|
</li>
|
||||||
`, hyphaName, rev.timeHourMinute(), rev.Hash, rev.Message, author)
|
`, hyphaName, rev.timeToDisplay(), rev.Hash, rev.Message, author)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return time like 13:42
|
// Return time like mm-dd 13:42
|
||||||
func (rev *Revision) timeHourMinute() string {
|
func (rev *Revision) timeToDisplay() string {
|
||||||
|
D := rev.Time.Day()
|
||||||
h, m, _ := rev.Time.Clock()
|
h, m, _ := rev.Time.Clock()
|
||||||
return strconv.Itoa(h) + ":" + strconv.Itoa(m)
|
return fmt.Sprintf("%02d — %02d:%02d", D, h, m)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This regex is wrapped in "". For some reason, these quotes appear at some time and we have to get rid of them.
|
// This regex is wrapped in "". For some reason, these quotes appear at some time and we have to get rid of them.
|
||||||
|
Loading…
Reference in New Issue
Block a user