From f61349e6ed2f190dd89bc74786eb106ec79e4262 Mon Sep 17 00:00:00 2001 From: Benjamin Auder Date: Mon, 19 Nov 2018 18:23:34 +0100 Subject: [PATCH] Fix date in PGN: months start at 0 --- public/javascripts/base_rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"]
'; const d = new Date(); const opponent = this.mode=="human" ? "Anonymous" : "Computer"; - pgn += '[Date "' + d.getFullYear() + '-' + d.getMonth() + '-' + d.getDate() + '"]
'; + pgn += '[Date "' + d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate() + '"]
'; pgn += '[White "' + (mycolor=='w'?'Myself':opponent) + '"]
'; pgn += '[Black "' + (mycolor=='b'?'Myself':opponent) + '"]
'; pgn += '[Fen "' + fenStart + '"]
'; -- 2.44.0