new(basic.gblib): New TOLIST, APPEND, SORT TO keyword..

This commit is contained in:
Rodrigo Rodriguez 2021-08-03 17:35:02 -03:00
parent dfa2d51e37
commit 24f4cc7f17
3 changed files with 11 additions and 7 deletions

View file

@ -139,8 +139,8 @@ export class DialogKeywords {
* @example TALK TOLIST (array, member)
*
*/
public toList(array, member) {
return Array.prototype.map.call(array, (item)=> { return item[member]; }).join(",");
public getToLst(array, member) {
return Array.prototype.map.call(array, (item) => { return item[member]; }).join(",");
}
/**
@ -153,7 +153,13 @@ export class DialogKeywords {
if (!(date instanceof Date)) {
date = new Date(date);
}
return date.getHours() + ':' + date.getMinutes();
function addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
return addZero(date.getHours()) + ':' + addZero(date.getMinutes());
}
/**

View file

@ -165,7 +165,7 @@ export class GBVMService extends GBService {
isarray = function(array){return Array.isArray(array) };
weekday = this.getWeekFromDate;
hour = this.getHourFromDate;
tolist = this.toList;
tolist = this.getToLst;
headers = {};
${code}

View file

@ -74,9 +74,6 @@ export class SystemKeywords {
this.dk = dk;
}
/**
* Retrives the content of a given URL.
*/
public async append(...args) {
return [].concat(...args);
}
@ -792,4 +789,5 @@ export class SystemKeywords {
public async numberOnly(text: string) {
return text.replace(/\D/gi, '');
}
}