Zoom Calendar

This commit is contained in:
Paolo Arena
2020-01-21 01:37:15 +01:00
parent 905c4a4a62
commit f5355c3a54
6 changed files with 245 additions and 56 deletions

View File

@@ -36,8 +36,6 @@ webpush.setVapidDetails(subject, publicVapidKey, privateVapidKey);
// console.log('setVapidDetails... config...');
// To Translate!
textlang = {
it: {
@@ -117,7 +115,7 @@ module.exports = {
gettranslate(text, lang) {
try {
return textlang[lang][text]
}catch (e) {
} catch (e) {
return textlang['it'][text]
}
},
@@ -128,7 +126,7 @@ module.exports = {
lang = msg.from.language_code;
try {
return textlang[lang][text]
}catch (e) {
} catch (e) {
return textlang['it'][text]
}
},
@@ -138,7 +136,7 @@ module.exports = {
let lang = 'it';
try {
return textlang[lang][text]
}catch (e) {
} catch (e) {
return textlang['it'][text]
}
},
@@ -649,6 +647,33 @@ module.exports = {
return mydate
},
appendLeadingZeroes(n) {
if (n <= 9) {
return "0" + n;
}
return n
},
getWeekDay(date) {
//Create an array containing each day, starting with Sunday.
const weekdays = [
"Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedí", "Venerdì", "Sabato"
];
//Use the getDay() method to get the day.
const day = date.getDay();
//Return the element that corresponds to that index.
return weekdays[day];
},
getstrDateTimeShort(mydate) {
// console.log('getstrDate', mytimestamp)
return this.getWeekDay(mydate) + ' ' + this.appendLeadingZeroes(mydate.getDate()) + '/' + this.appendLeadingZeroes(mydate.getMonth() + 1) + ' ORE ' + this.appendLeadingZeroes(mydate.getHours()) + ':' + this.appendLeadingZeroes(mydate.getMinutes());
},
getlinkzoom(idconf) {
return 'https://zoom.us/j/' + idconf
},
getmd5(mystr) {
return CryptoJS.MD5(mystr.toLowerCase()).toString();
},
@@ -786,7 +811,7 @@ module.exports = {
if (campi.length === 2) {
namesurname.name = campi[0];
namesurname.surname = campi[1];
}else if (campi.length === 3) {
} else if (campi.length === 3) {
if (suffissoCognome.includes(campi[1])) {
namesurname.name = campi[0];
namesurname.surname = campi[1] + " " + campi[2];
@@ -794,10 +819,10 @@ module.exports = {
namesurname.name = campi[0] + " " + campi[1];
namesurname.surname = campi[2];
}
}else if (campi.length === 4) {
} else if (campi.length === 4) {
namesurname.name = campi[0] + " " + campi[1];
namesurname.surname = campi[2] + " " + campi[3];
}else if (campi.length > 4) {
} else if (campi.length > 4) {
namesurname.name = campi[0] + " " + campi[1];
namesurname.surname = " " + campi[2];
for (let ind = 3; ind < campi.length; ind++) {