- Generazione PDF e per Stampa

This commit is contained in:
Surya Paolo
2025-05-12 16:34:04 +02:00
parent 09a05a11d5
commit 5ab24b2abd
3 changed files with 54 additions and 15 deletions

View File

@@ -6268,7 +6268,32 @@ module.exports = {
return Array.from(mystr).map(char => accentsMap.get(char) || char).join('');
},
getDateYYYYMMDD_Today() {
// Ottieni la data attuale nel formato YYYY-MM-DD
const today = new Date();
const formattedDate = today.toISOString().split('T')[0]; // Format YYYY-MM-DD
return formattedDate
},
convertFullFileNameToURL(idapp, fullfilename) {
const mydir = this.getdirByIdApp(idapp);
const myhost = this.getHostByIdApp(idapp);
// ++ remove mydir from fullfilename and add myhost to generate a URL
const url = fullfilename.replace(mydir, '').replace(/\\/g, '/'); // Replace backslashes with slashes
const myurl = myhost + '/' + url;
console.log('myurl', myurl);
return myurl;
},
removePathDirByFileName(idapp, fullfilename) {
const mydir = this.getdirByIdApp(idapp);
// ++ remove mydir from fullfilename and add myhost to generate a URL
const filename = fullfilename.replace(mydir, '').replace(/\\/g, '/'); // Replace backslashes with slashes
return filename;
},
};