diff --git a/main.go b/main.go index e4760c3..0c7292d 100644 --- a/main.go +++ b/main.go @@ -400,11 +400,11 @@ func prepareDays(t time.Time) []Day { endOfMonth := false for i := 0; i < 6; i++ { - _, week := curDate.ISOWeek() + year, week := curDate.ISOWeek() days = append(days, Day{ Class: "week day", Text: fmt.Sprintf("%02d", week), - URL: "", + URL: fmt.Sprintf("/edit/%s", formatWeekPageName(year, week)), Count: "", }) @@ -447,6 +447,10 @@ func prepareDays(t time.Time) []Day { return days } +func formatWeekPageName(year int, week int) string { + return fmt.Sprintf("%04dW%02d", year, week) +} + func timeEqual(date time.Time, today time.Time) bool { if date.Year() != today.Year() { return false