diff --git a/src/shared/util.js b/src/shared/util.js index cd3a9486b..36069efdc 100644 --- a/src/shared/util.js +++ b/src/shared/util.js @@ -832,11 +832,11 @@ function isArrayEqual(arr1, arr2) { }); } -function getModificationDate(date = new Date(Date.now())) { +function getModificationDate(date = new Date()) { const buffer = [ date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), - (date.getUTCDate() + 1).toString().padStart(2, "0"), + date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0"), diff --git a/test/unit/util_spec.js b/test/unit/util_spec.js index 845447ff1..461d77940 100644 --- a/test/unit/util_spec.js +++ b/test/unit/util_spec.js @@ -330,7 +330,7 @@ describe("util", function () { describe("getModificationDate", function () { it("should get a correctly formatted date", function () { const date = new Date(Date.UTC(3141, 5, 9, 2, 6, 53)); - expect(getModificationDate(date)).toEqual("31410610020653"); + expect(getModificationDate(date)).toEqual("31410609020653"); }); });