fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit 296b999ec3 - Show all commits

View file

@ -464,6 +464,7 @@ export class SystemKeywords {
case 'date':
const resultDate = SystemKeywords.getDateFromLocaleString(result, contentLocale);
if (resultDate) {
switch (filter.operator) {
case '=':
if (resultDate.getTime() == filter.value.getTime())
@ -487,6 +488,9 @@ export class SystemKeywords {
break;
}
break;
} else {
GBLog.info(`BASIC: FIND with NULL date in filter.`);
}
}
});
@ -517,6 +521,7 @@ export class SystemKeywords {
private static getDateFromLocaleString(date: any, contentLocale: any) {
const parts = /^([0-3]?[0-9]).([0-3]?[0-9]).((?:[0-9]{2})?[0-9]{2})$/gi.exec(date);
if (parts[3]) {
switch (contentLocale) {
case 'pt':
date = new Date(Number.parseInt(parts[2]), Number.parseInt(parts[1]), Number.parseInt(parts[3]), 0, 0, 0, 0);
@ -527,6 +532,10 @@ export class SystemKeywords {
}
return date;
}
else {
return null;
}
}
/**
* Creates a folder in the bot instance drive.