@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(); }
@XmlElement public int getPublishedForNbDays() { return UnitUtil.getTimeData(DateUtil.getNow().getTime() - getDate().getTime()) .getTimeConverted(TimeUnit.DAY) .intValue(); }