コード例 #1
0
 @XmlElement
 public String getPublishedFor() {
   TimeData timeData = UnitUtil.getTimeData(DateUtil.getNow().getTime() - getDate().getTime());
   TimeUnit bestUnit = timeData.getBestUnit();
   return UnitUtil.getTimeData(
           new BigDecimal(String.valueOf(timeData.getBestValue().intValue())), bestUnit)
       .getBestDisplayValue();
 }
コード例 #2
0
 @XmlElement
 public int getPublishedForNbDays() {
   return UnitUtil.getTimeData(DateUtil.getNow().getTime() - getDate().getTime())
       .getTimeConverted(TimeUnit.DAY)
       .intValue();
 }