From df039b0f3c8fb5f0ccb08817477af5c51ff2a806 Mon Sep 17 00:00:00 2001 From: kkapsner Date: Tue, 30 May 2023 13:48:25 +0200 Subject: [PATCH] Do not use UTC for alpha version --- .tools/build.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.tools/build.js b/.tools/build.js index f79c5f1..8ce03ba 100644 --- a/.tools/build.js +++ b/.tools/build.js @@ -16,8 +16,13 @@ const fs = require("fs"); function getAlphaVersion(manifest, useTime){ "use strict"; + function f(n){ + if (n < 10) return "0" + n.toString(10); + return n.toString(10); + } const now = new Date(); - const date = now.toISOString().substring(0, useTime? 13: 10).replace(/-/g, "").replace("T", "."); + // const date = now.toISOString().substring(0, useTime? 13: 10).replace(/-/g, "").replace("T", "."); + const date = `${now.getFullYear()}${f(now.getMonth() + 1)}${f(now.getDate())}${useTime? "." + f(now.getHours): ""}`; return manifest.version.replace(/^([\d.]+).*$/, "$1Alpha" + date); } function getRCVersion(manifest){