From: Benjamin Auder <benjamin.auder@somewhere>
Date: Mon, 19 Nov 2018 17:23:34 +0000 (+0100)
Subject: Fix date in PGN: months start at 0
X-Git-Url: https://git.auder.net/variants/current/css/img/pieces/doc/common.css?a=commitdiff_plain;h=f61349e6ed2f190dd89bc74786eb106ec79e4262;p=vchess.git

Fix date in PGN: months start at 0
---

diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js
index c0dc826f..99574b45 100644
--- a/public/javascripts/base_rules.js
+++ b/public/javascripts/base_rules.js
@@ -1043,7 +1043,7 @@ class ChessRules
 		pgn += '[Site "vchess.club"]<br>';
 		const d = new Date();
 		const opponent = this.mode=="human" ? "Anonymous" : "Computer";
-		pgn += '[Date "' + d.getFullYear() + '-' + d.getMonth() + '-' + d.getDate() + '"]<br>';
+		pgn += '[Date "' + d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate() + '"]<br>';
 		pgn += '[White "' + (mycolor=='w'?'Myself':opponent) + '"]<br>';
 		pgn += '[Black "' + (mycolor=='b'?'Myself':opponent) + '"]<br>';
 		pgn += '[Fen "' + fenStart + '"]<br>';