From 85c3f67851480f35e57d39509d5937be5aaec7a2 Mon Sep 17 00:00:00 2001 From: Thomas Heritage Date: Fri, 13 Sep 2024 18:57:38 +0100 Subject: [PATCH] entryHeader time setter more tolerant * Allows parameter to the `time` setter to be any parameter accepted by the `Date` constructor * Re-instates the functionality removed at: https://github.com/cthackers/adm-zip/pull/518/commits/6e717adfd9f7ae3ed5b9fd0d6861d851b592eda1#diff-6af03ff88c79ec964bc6482f32561df5347e564bd58f5aa1e1801682d4c49842L33 * Closes #539 --- headers/entryHeader.js | 1 + 1 file changed, 1 insertion(+) diff --git a/headers/entryHeader.js b/headers/entryHeader.js index 61000ad..6f54e7a 100644 --- a/headers/entryHeader.js +++ b/headers/entryHeader.js @@ -98,6 +98,7 @@ module.exports = function () { return Utils.fromDOS2Date(this.timeval); }, set time(val) { + val = new Date(val); this.timeval = Utils.fromDate2DOS(val); },