Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Let's say that you have such use cases:
To fulfill this case, you can simply use a Bean Shell Formatter on a column with date values to perform the calculation with this script below:
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