livello dati C++ (datastore JSON, 33 controlli) e schermate Home, scheda ordine e cover; .gitignore per gli artefatti

This commit is contained in:
2026-10-09 09:09:31 +02:00
parent b1ee0c78b5
commit 40e4badbd4
17 changed files with 1248 additions and 56 deletions
+24 -1
View File
@@ -229,6 +229,26 @@ function statusKey(days) {
return "in_days";
}
// Data come nella card dell'app Android: gg/mm/aaaa.
function formatDay(iso) {
var d = parseIso(iso);
if (!d) return String(iso || "");
return pad2(d.getDate()) + "/" + pad2(d.getMonth() + 1) + "/" + d.getFullYear();
}
// Istante corrente in ISO 8601 (usato per createdAt delle prenotazioni).
function nowIso() {
var n = new Date();
return n.getFullYear() + "-" + pad2(n.getMonth() + 1) + "-" + pad2(n.getDate())
+ "T" + pad2(n.getHours()) + ":" + pad2(n.getMinutes()) + ":" + pad2(n.getSeconds())
+ ".000";
}
// Identificativo come nell'app Flutter (microsecondi dell'epoca).
function newId() {
return String(new Date().getTime()) + String(Math.floor(Math.random() * 1000));
}
// Guard per i test node: in QML `module` non esiste, le funzioni top-level
// sono gia' visibili al file che importa questo modulo.
if (typeof module !== "undefined" && module.exports) {
@@ -250,6 +270,9 @@ if (typeof module !== "undefined" && module.exports) {
pendingEggs: pendingEggs,
estimateDeliveryDate: estimateDeliveryDate,
refreshDeliveryDates: refreshDeliveryDates,
statusKey: statusKey
statusKey: statusKey,
formatDay: formatDay,
nowIso: nowIso,
newId: newId
};
}