Browse Source

Remove hardcoding for current week

Toni Fadjukoff 7 years ago
parent
commit
e120e26b13
1 changed files with 4 additions and 1 deletions
  1. 4 1
      bot.go

+ 4 - 1
bot.go View File

@@ -236,12 +236,15 @@ func fixAverages(title string) error {
236 236
 		return err
237 237
 	}
238 238
 
239
-	currentWeek := 2
239
+	_, currentWeek := time.Now().ISOWeek()
240 240
 	numberReg, _ := regexp.Compile("\\d+")
241 241
 	for _, section := range sections {
242 242
 		weekStr := numberReg.FindString(section.title)
243 243
 		if weekStr != "" {
244 244
 			weekNumber, _ := strconv.Atoi(weekStr)
245
+			if weekNumber < currentWeek-1 {
246
+				continue
247
+			}
245 248
 			if weekNumber > currentWeek {
246 249
 				break
247 250
 			}