Compare commits

..

No commits in common. "a4a9a5ca7a0ebcb80137a76c6ade117c3fb842c4" and "27200abc582dea2ff9a58a6f35f5fb4b302e8e9a" have entirely different histories.

17
main.go
View File

@ -388,23 +388,18 @@ func prepareDays(t time.Time) []Day {
var days []Day
curDate := t.AddDate(0, 0, -(t.Day()-1))
preDays := int(curDate.Weekday())
if preDays == 0 {
preDays = 7
}
preDays -= 1
curDate := t.AddDate(0, 0, -t.Day()+1)
preDays := int(curDate.Weekday()) - 1
maxDays := daysInMonth(curDate.Year(), curDate.Month())
endOfMonth := false
for i := 0; i < 6; i++ {
year, week := curDate.ISOWeek()
_, week := curDate.ISOWeek()
days = append(days, Day{
Class: "week day",
Text: fmt.Sprintf("%02d", week),
URL: fmt.Sprintf("/edit/%s", formatWeekPageName(year, week)),
URL: "",
Count: "",
})
@ -447,10 +442,6 @@ 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