[MOBILE] Script doesn't work!

21 Aug '15, 07:27 PM
14,664 Views
No Forum Badges

#input Date birthDate, Date currentDate
#output boolean adult

def startTime = birthDate.getTime()
def endTime = currentDate.getTime()

def diffDays = (endTime.minus(startTime))/86400000

def tempAdult = true

if (diffDays > 6570) {
    tempAdult = true;
} else {
    tempAdult = false;
}

return ["adult" : tempAdult]

This .groovy script doesn't work and I can't understand why. Maybe I need to import some library?

 
x 0
Follow
Answer Answer at this question and get points!
No Forum Badges

I was missing an import:

import org.apache.commons.lang.time

 

 
x 0
No Forum Badges

I think problem is internal i let you know in few weeks after check it properly. Anyway thanks for share it with me here.

 
x 0
Answer at this question and get points!

Related questions

add html Add logging capability to a Groovy script (unit) Add select all to Checkable List aggiornamento fallito a causa di un errore interno AJAX events problem to external JavaScript Automatic file upload Avvio chiamata dispositivo Bluetooth Cambiare dimensioni bottoni - Change button size Can not get generate and run option for DataService Project Codigo QR Confirm dialog for mobile Content module page variable won't assign. Convert selector component result to single value Criptare dati sensibili nel database Customize layout mobile platform Database connection, Host and Port number Database List is not showing up in App Emulator Data flow from a page which is not visible anymore Data Management: Updating Data - Attachments - Updating Data Sample Project Final DataService Projects and Mobile Projects in WebRatio Community Emular una App Errore su mobile-custom-components Error testing mobil app in android Execute truncate sql query file analysis then update MySQL database Form template Get size of Multi Form with Pictures Object Array Getting the absolute path of a RTXBLOBData Grabar informacion localmente - WebRatio mobile Groovy and Database Groovy script numer after an error How can I add a credit card payment gateway or integrate paypal in my web app logic? How can i add html into a page? How can I interact using a iOS (iPhone/iPad) client with a WebRatio app? how can i open a pdf file using download dialog How to calculate dates between start and end point? How to Retreive data from Multi Selection Field Array Importing JAR Libraries into Script Unit Importing jar library integrate framework to webratio mobile is possible integrate CartoDB in WebRatio Mobbile apps? JAR importing Make a call from Mobile APP Merge the result of 2 (or more) flows [MOBILE] Can't synchronize domain model with beck end DB [MOBILE] Errore Field Mandatory [MOBILE] How I extract information from JSON client side? Mobile platform : List view - add / remove row Mobile Platform - using device specific features Modify generated code / inject own HTML, Javascript code into existing generted code. Mostrare un bottone solo in determinati casi REST connection and Mobile App deploy script component Script eseguito alla User Login Script Unit e Mysql ScritpUnit and JSON data Setting Upload directory Shuffling Script Standard confirm dialog replacement Supoort for Mobile and Desktop display Sync DataService Project with Mobile Project Trying to Synchronize Domain Model Unable to execute the script java.lang.NullPointerException upload file and the move it to other location WebRatio 6.1.2: Groovy Version / Versione Groovy Web Ratio Mobile and Foreign Key Web Ratio Mobile plateform Macos Sierra WebRatio Mobile Platform Community edition - Restful request Web Ratio Mobile - Remote data mapping problem