Skip to content

Commit eea97ea

Browse files
Merge pull request #12356 from calixteman/no_future
Set the modification date to the current day when saving
2 parents e8822e1 + 908e7ae commit eea97ea

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/shared/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,11 @@ function isArrayEqual(arr1, arr2) {
832832
});
833833
}
834834

835-
function getModificationDate(date = new Date(Date.now())) {
835+
function getModificationDate(date = new Date()) {
836836
const buffer = [
837837
date.getUTCFullYear().toString(),
838838
(date.getUTCMonth() + 1).toString().padStart(2, "0"),
839-
(date.getUTCDate() + 1).toString().padStart(2, "0"),
839+
date.getUTCDate().toString().padStart(2, "0"),
840840
date.getUTCHours().toString().padStart(2, "0"),
841841
date.getUTCMinutes().toString().padStart(2, "0"),
842842
date.getUTCSeconds().toString().padStart(2, "0"),

test/unit/util_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ describe("util", function () {
330330
describe("getModificationDate", function () {
331331
it("should get a correctly formatted date", function () {
332332
const date = new Date(Date.UTC(3141, 5, 9, 2, 6, 53));
333-
expect(getModificationDate(date)).toEqual("31410610020653");
333+
expect(getModificationDate(date)).toEqual("31410609020653");
334334
});
335335
});
336336

0 commit comments

Comments
 (0)