Skip to content

Commit c152767

Browse files
authoredMar 28, 2024··
Actually use the correct method for calculating deprecation warning window (#6929)
* Actually use the correct method for calculating deprecation warning windows * Run formatter
1 parent 3fb3240 commit c152767

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/deploy/functions/runtimes/supported.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ export function guardVersionSupport(runtime: Runtime, now: Date = new Date()): v
195195
return;
196196
}
197197

198-
const warning = new Date();
199-
warning.setDate(deprecation.getDate() - 90);
198+
// Subtract 90d (90 * milliseconds per day) to get warning period
199+
const warning = new Date(deprecation.getTime() - 90 * 24 * 60 * 60 * 1000);
200200
if (now >= warning) {
201201
utils.logLabeledWarning(
202202
"functions",

0 commit comments

Comments
 (0)
Please sign in to comment.