Ejemplo n.º 1
0
 public String getCreateDateString() {
   if (createDateString == null || createDateString.trim().equals("")) {
     return RiceConstants.getDefaultDateFormat().format(getCreateDate());
   } else {
     return createDateString;
   }
 }
Ejemplo n.º 2
0
 public String getFormattedCreateDate() {
   long time = getDocCreationDate().getTime();
   Calendar calendar = Calendar.getInstance();
   calendar.setTimeInMillis(time);
   Date date = calendar.getTime();
   DateFormat dateFormat = RiceConstants.getDefaultDateFormat();
   return dateFormat.format(date);
 }
Ejemplo n.º 3
0
 public Timestamp formatDate(String dateLabel, String dateString) throws XmlException {
   if (StringUtils.isBlank(dateString)) {
     return null;
   }
   try {
     return new Timestamp(RiceConstants.getDefaultDateFormat().parse(dateString).getTime());
   } catch (ParseException e) {
     throw new XmlException(
         dateLabel
             + " is not in the proper format.  Should have been: "
             + RiceConstants.DEFAULT_DATE_FORMAT_PATTERN);
   }
 }