diff --git a/screenshots/html/script.js b/screenshots/html/script.js
index 5e4fb18133..d6b7690532 100644
--- a/screenshots/html/script.js
+++ b/screenshots/html/script.js
@@ -149,6 +149,7 @@ function addForm() {
};
label2.appendChild(input2);
form.appendChild(label2);
+ /*
// Add a date picker to input the minimum date of modification
const label3 = document.createElement('label');
label3.textContent = 'If modified since:';
@@ -168,6 +169,7 @@ function addForm() {
addTable();
};
form.appendChild(dateInput);
+ */
// Add a span with id result to display the number of lines
const lines = document.createElement('span');
lines.id = 'lines';
@@ -191,6 +193,13 @@ function createMissingImageElement() {
return text;
}
+function createUpToDateImageElement() {
+ const text = document.createElement('p');
+ text.className = "missing";
+ text.textContent = 'Image not updated';
+ return text;
+}
+
function convertToHumanReadableDate(modifiedDayTime) {
var date = new Date(modifiedDayTime * 86400000);
return date.toLocaleDateString();
@@ -270,6 +279,8 @@ function addTable() {
const foreignFile = englishFile.replace("en]", `${dataLanguages[languageIndex]}]`).replace("_S_", "_T_")
const fullForeignFile = `${dataLanguages[languageIndex]}/${foreignFile}.png`;
td.appendChild(createImageElement(fullForeignFile, modifiedDayTime));
+ } else {
+ td.appendChild(createUpToDateImageElement());
}
}
tr.appendChild(td);
diff --git a/tools/test/generateAllScreenshots.py b/tools/test/generateAllScreenshots.py
index e92f69b0fd..0018833c1c 100755
--- a/tools/test/generateAllScreenshots.py
+++ b/tools/test/generateAllScreenshots.py
@@ -18,6 +18,7 @@
import os
import re
import sys
+import time
from util import compare
@@ -134,6 +135,9 @@ def generateJavascriptFile():
if os.path.exists(translatedFile):
# Get the last modified date of the file in seconds and round to days
date = os.popen("git log -1 --format=%ct -- \"" + translatedFile + "\"").read().strip()
+ # if date is empty, use today's date
+ if date == "":
+ date = time.time()
dateDay = int(date) // 86400
dataForFile.append(dateDay)
else: