diff options
-rw-r--r-- | tjp.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -117,12 +117,16 @@ func formatVertically(id sql.NullInt64, dateAdded sql.NullTime, entry sql.NullSt } func formatHorizontally(dateAdded sql.NullTime, entry sql.NullString, comment sql.NullString) { - fmt.Printf("%s | %s | %s\n", formatShortTime(dateAdded), formatString(entry), formatString(comment)) + fmt.Printf("%s %s | %s | %s\n", formatShortTime(dateAdded), getWeekdayFromDate(dateAdded), formatString(entry), formatString(comment)) +} + +func getWeekdayFromDate(date sql.NullTime) string { + return date.Time.Format("Monday") } func formatShortTime(t sql.NullTime) string { if t.Valid { - return t.Time.Format("2006-01-02T15:04") + return t.Time.Format("2006-01-02 15:04") } return "NULL" } |