List of usage examples for org.joda.time Duration getStandardDays
public long getStandardDays()
From source file:web.StreamMeetupComTask.java
License:Apache License
private String getUpfrontReservationTime(Long dateInMillis) { DateTime now = new DateTime(DateTimeZone.forTimeZone(TimeZone.getTimeZone("UTC"))); DateTime event = new DateTime(dateInMillis, DateTimeZone.forTimeZone(TimeZone.getTimeZone("UTC"))); Duration duration = new Duration(now, event); if (duration.getMillis() < 0) { return "-1"; } else if (duration.getStandardSeconds() < 86400) { return "1d"; } else if (duration.getStandardDays() < 4) { return "4d"; } else if (duration.getStandardDays() < 7) { return "1w"; } else if (duration.getStandardDays() < 14) { return "2w"; } else if (duration.getStandardDays() < 28) { return "4w"; } else if (duration.getStandardDays() < 56) { return "8w"; } else {//from w ww . j av a 2 s. c o m return "-"; } }