Description

  • org.joget.commons.util.DateUtil
  • Under wflow-commons module
  • Utility methods to deal with date value

Code Sample

import org.joget.commons.util.DateUtil;
 
String dateValue = "2015-06-01";
String format = "yyyy-MM-dd";
 
//check the format
boolean valid = DateUtil.validateDateFormat(dateValue, format);

Methods

compare
public static boolean compare(String start, String end, String format)

To check an end date is after a start date. Format following syntax of java.text.SimpleDateFormat.

validateDateFormat
public static boolean validateDateFormat(String value, String format)

To validate a date value is in correct date format. Format following syntax of java.text.SimpleDateFormat.

 

 

  • No labels