Skip to content

Commit

Permalink
Update expire-old-content.js
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
RichardKanshen and coderabbitai[bot] authored Nov 10, 2024
1 parent 1324120 commit cb9e9f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion expire-old-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function updateOldComponents() {
// First pass: collect expired image names that should be removed
content.replace(/<img [^>]*src=\{([^}]+)\}[^>]*valid-until="([^"]+)"[^>]*>/g, (match, imgVar, dateStr) => {
const expirationDate = new Date(dateStr);
if (isNaN(expirationDate.getTime())) {
if (Number.isNaN(expirationDate.getTime())) {
console.log(`WARNING! Invalid date format - ${dateStr}`);
return match;
}
Expand Down

0 comments on commit cb9e9f7

Please sign in to comment.