1
0
Prechádzať zdrojové kódy

Next lesson date display was incorrect - trying to fix it.

Netuttki 3 rokov pred
rodič
commit
0c971dffb0
1 zmenil súbory, kde vykonal 10 pridanie a 3 odobranie
  1. 10 3
      locations/music_guitarlesson.qsrc

+ 10 - 3
locations/music_guitarlesson.qsrc

@@ -124,17 +124,24 @@ end
 
 if $ARGS[0] = 'getdate':
 	newday = day + (ml_guitarlesson['lessonday'] + 7 - week)
-	newmonth = month + 1
+	newmonth = month
 	if (month = 1 or month = 3 or month = 5 or month = 7 or month = 8 or month = 10 or month = 12) and newday > 31:
 		newday -= 31
 	elseif month = 2:
 		if (year mod 4 = 0):
-		  if newday > 29: newday -= 29
+			if newday > 29: 
+		  		newday -= 29
+				newmonth += 1
+			end
 		else 
-		  if newday > 28: newday -= 28
+			if newday > 28: 
+		  		newday -= 28 
+				newmonth += 1
+			end
 		end
 	elseif newday > 30:
 		newday -= 30
+		newmonth += 1
 	end	
 end