Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Figure 1
Figure 2
Code Sample 1:
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); try { Date date = formatter.parse(value); Calendar cal = Calendar.getInstance(); if (date.before(cal.getTime())) { return "Expired"; } else { return "Active"; } } catch (ParseException e) { e.printStackTrace(); }
Code Sample 2:
This code has added logic to show nearing expiry date with status "Expiring Soon in 30 days".
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); try { Date date = formatter.parse(value); Calendar cal = Calendar.getInstance(); if (date.before(cal.getTime())) { return "Expired"; //before today = expiried } cal.add(Calendar.DAY_OF_MONTH, 30); //increase today's date by 30 days if (date.before(cal.getTime())) { return "Expiring Soon in 30 days"; //between now and next 30 days }else{ return "Active"; //more than 30 days ahead } } catch (ParseException e) { e.printStackTrace(); }