From a list of business objects, return the earliest date as a DtpDate object.
Syntax
public static DtpDate getMinDate(BusObjArray boList, String attr, String dateFormat)
Parameters
Return values
A DtpDate object which contains the earliest date.
Exceptions
DtpIncompatibleBOTypeException - When the business objects in the list are not the same business object type.
DtpUnknownAttributeException - When the specified attribute is not a valid attribute in the business objects passed in.
DtpUnsupportedAttributeTypeException - When the type of the specified attribute is not one of the supported attribute types listed above.
All of these exceptions are subclasses of RunTimeEntityException.
Notes
The getMinDate() method scans through the list of business objects looking for the business object with the earliest date, and return that date in the form of a DtpDate object.
In the evaluation of dates, Jan 1, 1999 000000 is earlier than Jan 1, 2002 000000, which is earlier than Jan 1, 2004 000000.
The date information is assumed to be stored in the attribute name passed into the method. If an object has null date information, it is ignored. If all objects have null date information, null is returned.
Examples
try { DtpDate minDate = DtpDate.getMinDate(bos, "Start Date", "D/M/Y h:m:s"); } catch ( RunTimeEntityException err ) { System.out.println(err.getMessage()); }
See also