Custom Commands de ejemplo

From GXtest Wiki
Revision as of 22:42, 8 June 2011 by Fbaptista (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Ejemplos de custom commands. Se pueden agregar directamente o obtener una idea de como realizarlos / usarlos

Comparar si un control tiene la fecha de hoy

   function CustomCommand (paramJS, currentGXVersion, currentLanguage){
       var dia=((new Date().getDate()<10) ? "0" : "")+new Date().getDate(); 
       var mes=(new Date().getMonth()+1<10) ? "0" +(new Date().getMonth()+1): new Date().getMonth()+1;
       var year=(((new Date().getFullYear())%100<10) ? "0":"") +(new Date().getFullYear())%100;
       var fecha=mes.concat("/".concat(dia.concat("/".concat(year))));
       if((paramJS==fecha)){
           result = "OK";
       }else{
           result = "Mal, la fecha no es la de hoy";
       }  
   return result;
   }