Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
...
Code Block | ||
---|---|---|
| ||
import java.text.ParseException; import java.time.LocalDate; import java.time.Period; try { LocalDate birthDate = LocalDate.parse(value); LocalDate currentDate = LocalDate.now(); Period dateDiff = Period.between(birthDate, currentDate); return dateDiff.getYears() + " YEAR(s) & " + dateDiff.getMonths() + " MONTH(s)"; } catch (ParseException e) { e.printStackTrace(); } |
To quickly see how this script works, feel free to try this sample app below:
APP_beanshellformatter_calculation-SAMPLE.jwa