From: Benjamin Auder 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/%7B%7B%20asset%28%27mixstore/images/css/img/current/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"]
'; 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 + '"]
';