Set the modification date to the current day when saving
This commit is contained in:
parent
e51e9d1f33
commit
908e7ae5e4
@ -832,11 +832,11 @@ function isArrayEqual(arr1, arr2) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getModificationDate(date = new Date(Date.now())) {
|
function getModificationDate(date = new Date()) {
|
||||||
const buffer = [
|
const buffer = [
|
||||||
date.getUTCFullYear().toString(),
|
date.getUTCFullYear().toString(),
|
||||||
(date.getUTCMonth() + 1).toString().padStart(2, "0"),
|
(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.getUTCHours().toString().padStart(2, "0"),
|
||||||
date.getUTCMinutes().toString().padStart(2, "0"),
|
date.getUTCMinutes().toString().padStart(2, "0"),
|
||||||
date.getUTCSeconds().toString().padStart(2, "0"),
|
date.getUTCSeconds().toString().padStart(2, "0"),
|
||||||
|
@ -330,7 +330,7 @@ describe("util", function () {
|
|||||||
describe("getModificationDate", function () {
|
describe("getModificationDate", function () {
|
||||||
it("should get a correctly formatted date", function () {
|
it("should get a correctly formatted date", function () {
|
||||||
const date = new Date(Date.UTC(3141, 5, 9, 2, 6, 53));
|
const date = new Date(Date.UTC(3141, 5, 9, 2, 6, 53));
|
||||||
expect(getModificationDate(date)).toEqual("31410610020653");
|
expect(getModificationDate(date)).toEqual("31410609020653");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user